Delphi – Int to Hex and Hex to Int
int2hex example in delphi:
1 2 3 4 5 6 7 8 9 |
var str : string; // hex value b : byte; begin b := 15; str := system.sysutils.inttohex(b,2); end; // the result in str will be : '0F' |
hex2int example:
1 2 3 4 5 6 7 8 9 |
var strHexVal : string; // hex value intVal : integer; begin strHexVal := '0F'; intVal := StrToInt('$' + strHexVal); end; // the result in intVal will be : 15 |