Filtri Menu 0 0.00

Delphi – Int to Hex and Hex to Int

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

Condividi:

Iscriviti alla newsletter

Iscriviti alla nostra newsletter per ricevere offerte di sconto anticipate, aggiornamenti e informazioni sui nuovi prodotti.
Top