uses System.SysUtils;
var
Hexadecimal, FromHex: Integer;
SHexadecimal: string;
begin
//十六进制字面量
Hexadecimal := $42;
//Hexadecimal is 66
//Delphi 中没有八进制和二进制字面量
//42 转十六进制字符串
SHexadecimal := IntToHex(42);
//SHexadecimal is '2A'
//十六进制字符串转整数:
//支持 "$" 和 "0x" 前缀
FromHex := StrToInt('$2A');
//FromHex is 42
WriteLn('hexadecimal = ', Hexadecimal);
WriteLn('sHexadecimal = ', SHexadecimal);
WriteLn('fromHex = ', FromHex);
end.