uses System.SysUtils;
var
Hexadecimal, FromHex: Integer;
SHexadecimal: string;
begin
//hexadecimal literal
Hexadecimal := $42;
//Hexadecimal is 66
//octal and binary literals
//do not exist in Delphi
//42 to hexadecimal string
SHexadecimal := IntToHex(42);
//SHexadecimal is '2A'
//hexadecimal string to integer:
//"$" and "0x" prefixes are supported
FromHex := StrToInt('$2A');
//FromHex is 42
WriteLn('hexadecimal = ', Hexadecimal);
WriteLn('sHexadecimal = ', SHexadecimal);
WriteLn('fromHex = ', FromHex);
end.