function hoge(n, base: integer): string; var x: integer; s: string; begin if (base <> 2) and (base <> 8) and (base <> 16) then base := 16; s := ''; repeat x := n mod base; if x < 10 then s := chr(ord('0') + x) + s else s := chr(ord('A') + x - 10) + s; n := n div base; until n <= 0; hoge := s; end;