//16进制 -> (4、8)进制
Function HexTo4(AiStr : String;
AiValue : Integer = 4) : String;
CONST
Convert = '0123456789ABCDEF';
Var
i, j : Integer;
begin
For i := 1 To Length(AiStr)do
begin
j := Pos(AiStr, Convert) - 1;
Result := Result + IntToStr(j Div AiValue) + IntToStr(j Mod AiValue);
end;
end;
Edit1.Text := HexTo4('FF');
//4进制
Edit1.Text := HexTo4('FF', 8);
//8进制