Code:
Function if_trimSurface(atoi:pchar):Boolean;
Begin result:=false;
if (atoi=nil) or (atoi^=#0) then exit;
while (atoi^ in [#9,#10,#13,#32]) do
do begin inc(atoi);result:=true;End;
End;
Function php_hexdec(atoi:pchar;hextoint:shortstring;elseerror:integer):Integer;
Var axlock:integer;
Begin axlock:=0;
if (atoi=nil) or (atoi^=#0) then atoi:=nil;
if (length(hextoint)>1) then
Begin hextoint:=concat('$'+trim(hextoint));
Val(hextoint, Result, axlock.h);
if axlock= 0 then exit;
End;
if (false=if_trimSurface(atoi)) then exit;
hextoint:=copy(strpas(atoi),1,127);
Val(hextoint,result,axlock);
if (axlock<>0) then result:=elseerror;
End; |