Browse Source

rtl: fixed val(hexnumber,nativeint,code)

mattias 6 years ago
parent
commit
55ac9ab11e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      packages/rtl/system.pas

+ 10 - 0
packages/rtl/system.pas

@@ -471,6 +471,16 @@ var
 begin
 begin
   Code:=0;
   Code:=0;
   x:=Number(S);
   x:=Number(S);
+  writeln('val ',x);
+  if isNaN(x) then
+    case copy(s,1,1) of
+    '$': x:=Number('0x'+copy(S,2));
+    '&': x:=Number('0o'+copy(S,2));
+    '%': x:=Number('0b'+copy(S,2));
+    else
+      Code:=1;
+      exit;
+    end;
   if isNaN(x) or (X<>Int(X)) then
   if isNaN(x) or (X<>Int(X)) then
     Code:=1
     Code:=1
   else
   else