Delphi – Int to Hex and Hex to Int
int2hex example in delphi:
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:
var
strHexVal : string; // hex value
intVal : integer;
begin
strHexVal := ‘0F’;
intVal := StrToInt(‘$’ + strHexVal);
end;
// the result in intVal will be : 15