Int2EHex Routines
Converts an Integer into a Hexadecimal (string) without Padding.

Unit
QESBPCSConvert

Overloaded Variants
Function Int2EHex(const L: LongInt): string;
Function Int2EHex(const L: Int64): string;

Declaration
Function Int2EHex(const L: LongInt): string;

Description
ESBBlankWhenZero can be set to True to have Zero returned as an Empty string.

Parameters
Value to Convert to String.

Category
String/Integer Conversion Routines

Implementation

function Int2EHex (const L: LongInt): string;
begin
     if ESBBlankWhenZero and (L = 0) then
     begin
          Result := '';
          Exit;
     end;

     try
          FmtStr (Result, '%x', [L]); // Format the string
     except
          Result := '';
     end;
End;

Declaration
Function Int2EHex(const L: Int64): string;

Implementation

function Int2EHex (const L: Int64): string;
begin
     if ESBBlankWhenZero and (L = 0) then
     begin
          Result := '';
          Exit;
     end;

     try
          FmtStr (Result, '%x', [L]); // Format the string
     except
          Result := '';
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com