"For developers", "Server scripts", "Functions description", "Converting types", "HexToInt".
Convert hexadecimal number to decimal number.
function HexToInt(sValue: string): cardinal;
Parameter |
Type |
Value |
---|---|---|
sValue |
string |
initial hexadecimal number as a string. |
Decimal number.
begin
mLogScript(IntToStr(HexToInt('FF')), 'FF');
mLogScript(IntToStr(HexToInt('FFFF')), 'FFFF');
mLogScript(IntToStr(HexToInt('ABCD')), 'ABCD');
end.
[17:20:02] (Log "HexToInt"): [FF] 255
[17:20:02] (Log "HexToInt"): [FFFF] 65535
[17:20:02] (Log "HexToInt"): [ABCD] 43981
[17:20:02] (Run "HexToInt"): Script operation time: 3 ms
[17:20:02] (Run "HexToInt"): Script done successfully.