mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-21 21:49:28 +02:00
rtl: fixed val(hexnumber,nativeint,code)
This commit is contained in:
parent
52ade4b10c
commit
55ac9ab11e
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user