Tips (1541)
function HexB(b: Byte): string; const HexChar: array[0..15] of char = '0123456789ABCDEF'; begin HexB := HexChar[b shr 4] + HexChar[b and $0F]; end; function HexW(w: Word): string; begin HexW := HexB(Hi(w)) + HexB(Lo(w)); end; function HexL(l: Longint): string; var HL: HiLo absolute l; begin HexL := HexW(HL.HiWord) + HexW(HL.LoWord); end; function HexP(p: Pointer): string; var HL: HiLo absolute p; begin HexP := HexW(HL.HiWord) + ':' + HexW(HL.LoWord); end;
Rate this tip: