LONG (four-byte signed integer)

Top  Previous  Next



LONG([initial value])

[,DIM( )] [,OVER( )] [,NAME( )] [,EXTERNAL] [,DLL] [,STATIC]






A four-byte signed integer.


Format: ± magnitude

| |................... |

Bits: 31 30 0

Range: -2,147,483,648 to 2,147,483,647


initial value

A numeric constant. If omitted, the initial value is zero, unless the AUTO attribute is present.


Dimension the variable as an array.


Share a memory location with another variable.


Specify an alternate, "external" name for the field.


Specify the variable is defined, and its memory is allocated, in an external library. Not valid within FILE, QUEUE, or GROUP declarations.


Specify the variable is defined in a .DLL. This is required in addition to the EXTERNAL attribute.


Specify the variable's memory is permanently allocated.


Specify memory for the variable is allocated once for each execution thread. Also implicitly adds the STATIC attribute on Procedure Local data.


Specify the variable has no initial value.


Specify the variable is not visible outside the module containing the CLASS methods. Valid only in a CLASS.


Specify the variable is not visible outside base CLASS and derived CLASS methods. Valid only in a CLASS.

LONG declares a four-byte signed integer, using the Intel 8086 long integer format. The high-order bit is the sign bit (0 = positive, 1 = negative). Negative values are represented in standard two's complement notation.

The equivalent of a Win32 LONG in Clarion.NET is the CLALONG type. Use of LONG in Clarion.NET programs are equivalent to the INT64 .NET data type.


Count1 LONG                         !Declare four-byte signed integer

Count2 LONG,OVER(Count1)            !Declare OVER the four-byte signed integer

Count3 LONG,DIM(4)                  !Declare it an array of 4 longs

Count4 LONG(5)                      !Declare with initial value

Count5 LONG,EXTERNAL                !Declare as external

Count6 LONG,EXTERNAL,DLL            !Declare as external in a .DLL

Count7 LONG,NAME('SixCount')        !Declare with external name

ExampleFile FILE,DRIVER('Clarion')  !Declare a file

Record       RECORD

Count8        LONG,NAME('Counter')  !Declare with external name




See Also: Clarion# Data Type Comparison Chart