Util.IntToHex

Top  Previous  Next

 

Syntax

function Util.IntToHex(Value: integer; Digits: integer): string

 

Alternative Names

ibec_IntToHex

 

Description

This formats the given Value into a hexadecimal string with at least the number of digits given in the Digits parameter.

 

The Return Value is a hex representation of the integer value.

 

Example

execute UDSBlock

as

begin

  /* returns 1000 */

  str1 = Util.IntToHex(4096, 2);

 

  /* returns 1000 */

  str2 = Util.IntToHex(4096, 4);

  

  /* returns 00001000 */

  str3 = Util.IntToHex(4096, 8);

  

  GUI.ShowMessage('Str1: ' || str1 || String.CRLF() ||

                  'Str2: ' || str2 || String.CRLF() ||

                           'Str3: ' || Str3);

end