var i : integer s : string; begin s := '$' + ThatHexString; i := StrToInt(a); end; |
CONST HEX : ARRAY['A'..'F'] OF INTEGER = (10,11,12,13,14,15); VAR str : String; Int, i : integer; BEGIN READLN(str); Int := 0; FOR i := 1 TO Length(str) DO IF str[i] < 'A' THEN Int := Int * 16 + ORD(str[i]) - 48 ELSE Int := Int * 16 + HEX[str[i]]; WRITELN(Int); READLN; END. |
HexString := Format('%0x',DecValue); |