home *** CD-ROM | disk | FTP | other *** search
-
- (******************************************************
- *
- * Procedure: itoh
- *
- * Purpose: converts an integer into a string of hex digits
- *
- * Example: s := itoh(i);
- *
- *)
-
- function itoh(i: integer): anystring; {integer to hex conversion}
- function d(i: integer): char;
- begin
- i := i and 15;
- if i > 9 then i := i + 7;
- d := chr(i + ord('0'));
- end;
- begin
- itoh := d(i shr 12) + d(i shr 8) + d(i shr 4) + d(i);
- end;
-
-