HEX

An item of type HEX is interpreted as a series of hexadecimal digits (0-9, a-f, and A-F), which are treated as characters. The length reflects the number of digits and ranges from 1 to 65534. To determine the number of bytes, divide by 2.

For an item of length 4, the internal bit representations of example values are as follows:

  // hexadecimal value 04 D2
  00000100 11010010

  // hexadecimal value FB 2E
  11111011 00101110

The primary use of an item of type HEX is to access a file or database field whose data type does not match another EGL primitive type.

You can assign a hexadecimal value by using a literal that is of type CHAR and that includes only characters in the range of hexadecimal digits, as in these examples:

  myHex01 = "ab02";
  
  myHex02 = "123E";

You can include a hexadecimal item as an operand in a logical expression, as in these examples:

  if (myHex01 = "aBCd")
    myFunction01();
  else 
    if (myHex > myHex02)
      myFunction02();
    end
  end

You cannot include a hexadecimal item in an arithmetic expression.

Related reference
Primitive types