(1)方法1
Function HexToDec(const Value :Integer ) : string;
var
s : string;
begin
s := '$' + IntToStr(Value);
Result := InToStr(StrToInt(s));
end;
(2)方法2
Funtion HexToDec(const Value :Integer) : string;
CONST HEX : ARRAY['A'..'F'] OF INTEGER =
(10,11,12,13,14,15);
VAR
str : String;
In : Integer;
i : integer;
BEGIN
Str := UpperCase(IntToStr(Value));
Int := 0;
FOR i := 1 TO Length(str) DO
IF str < 'A' THEN
Int := Int * 16 + ORD(str) - 48
ELSE
Int := Int * 16 + HEX[str];
Result := IntToStr(Int);
end;