Integer

This keyword declares an integer variable where the value is within the range from -2^31 to 2^31-1.

Syntax

Local Integer NAMELocal Integer NAME(DIMENSIONS)Variable Integer NAME(DIMENSIONS)Value Integer NAME(DIMENSIONS)Const Integer NAME(DIMENSIONS)

You can do several variable declarations on the same line, separated by a comma.

Local declarations create the variables in the current local variable class that is not seen by nested or calling subprograms. The Call / Subprog and func / Funprog insulate the local variables, as well as the calls of method by fmet.

Const, Variable, and Value declarations state the arguments sent by a Call, func, or fmet. With these syntaxes, you can omit the dimensions and the index ranges when the parenthesis are present. The calling program defines the dimension and index ranges.

Example

# Direct declarationsLocal Integer MYDISTANCE, MYAGE : # Local integer variablesLocal Integer VALUES(1..1024) : # An array of 1024 integer values# A sub-program sending integers and returning a resultFunprog SEND_INTEGERS(MYINT)Variable Integer MYINT(,) : # A 2 dimensions matrix of integers is sent as reference...End SEND_STATUS# A sub-program storing integersSubprog STORE_VALUES(LEVEL)Value Integer LEVEL(1..20) : # An array of 20 elements is sent (a copy is done when passing the arguments)...End

Comments

There is still a Global declaration variable that exists for variables that must be seen in the scope of a process execution, but its use is strongly discouraged.

Implicit data type conversion

The Integer data type will implicitly convert Tinyint, Shortint, Float, Double and Decimal to an Integer. For Decimal, Float and Double precision numbers the decimal portion of the number is truncated then the integer portion is assigned to the Integer under the constraints that the integer portion of Integer is limited to -2^31 to 2^31-1.

...


Local Integer MY_INTEGER # Declare Integer
MY_INTEGER = 78956.23 # Float, Double or Decimal conversion - MY_INTEGER = 78956

...

See also

Global, Local, Variable, Value, Const, Tinyint, Date, Shortint, Float, Double, Decimal, Char, Clbfile, Blbfile, Uuident, Datetime, Instance.