Skip to content

Hi Function

See Also: Miscellaneous Functions, Folded Integer, Low, Integer

Purpose

The Hi function returns the value of the upper 16 bits (left-most 2 bytes) of a Folded Integer value.

Return Type

Integer

Syntax

(Hi( {expression} ))

Parameters

  • {expression}: May be of any type except string. If it is not an integer, it will be converted to a signed integer first.

What It Does

DataFlex integers have a storage capacity of 32 binary bits (4 bytes). With the Hi and Low functions, a single integer can be used to encode two 16-bit (2-byte) values each. The value of the upper 16 bits only of an integer can be retrieved with the Hi function.

Move (Hi(iCoordinate)) to iRowNum

Notes

  • The {expression} value is a signed integer and may be in the range 0 to 2,147,483,647.

  • This function returns a value of type integer. If the {expression} parameter is not an integer, its value will be converted to a signed integer for use in this function. If the result of this function is moved to a variable of a type other than integer, its value will be converted to the destination type.

  • To combine two positive integer values into a single integer for subsequent disassembly by Hi and Low, multiply the value assigned to Hi by 65,536 and add it to the value assigned to Low.

  • Certain properties in the DataFlex class library (such as Size and Location) use folded integers for disassembly by the Hi and Low functions.