Field-Map Scripting

4.1.7.9 Int2Hex

Int2Hex function


Prototype:

function Int2Hex (const Value :integer; const Digits_ :integer) :string;

Description:

Converts the value of integer variable into hexadecimal.

Syntax:

variable := Int2Hex(Value, Digits);


Part

Description


variable

variable declared as string


Value

Variable declared as integer, containing the value to be converted


Digits

Variable declared as integer, specifics characters wide, if number of digits greater than a hexadecimal number, then the rest is added with zeros, see example (below)




Return value:

String value represents a hexadecimal number after conversion


Example:

1)

var

 value, digits: integer;

 hex: string;


begin

 value:= 178;

 digits:= 8;


 hex:= Int2Hex(value, digits);


 ShowMsg(IntToStr(value) + ' = ' + hex);

end.



Output in Field-Map Data Collector:


2)

var

 value, digits: integer;

 hex: string;


begin

 value:= 178;

 digits:= 0;


 hex:= Int2Hex(value, digits);


 ShowMsg(IntToStr(value) + ' = ' + hex);

end.



Output in Field-Map Data Collector:


See also:                

String2Float; Variant2Float; Variant2Integer; Variant2String; String2Variant; Boolean2Integer; Date2Integer; Integer2Date; Int2Hex; IntToHex; GetBitFromLastThreeDigits;

SetBitOfDouble; GetBitOfDouble; SetBitOfInteger;  GetBitIfInteger; SetBitOfBigInt;  GetBitOfBigInt