# Integer

### Purpose

Declares one or more Integer variables.

### Syntax

To declare Integer variables

Integer {identifier} […{identifier}]

Where

• Where {identifier} is a variable name for the new integer variable.

• {identifier} may be between 1 and 4096 characters in length, must start with a letter, and may not contain spaces. Recommended characters are 0-9, a-z, A-Z and _ (underscore).

To declare array variables of type Integer

Integer{dimension-list} {identifier} […{identifier}]

Where

• {dimension-list} is a list of one or more array dimensions for the array. A dimension list is declared using square brackets []. One pair of brackets is used to declare each dimension. If the array is static, then you must specify the static size of each dimension between each pair of brackets. i.e. [{size}]. For more information about declaring arrays refer to Array Variable Assignments.

• {identifier} may be between 1 and 4096 characters in length, must start with a letter, and may not contain spaces. Recommended characters are 0-9, a-z, A-Z and _ (underscore).

### What It Does

Integer declares integer variables. Integers are whole numbers (no decimals) in the range -2,147,483,648 to 2,147,483,647.

Multiple variables may be declared on one command line, with their names separated from each other by spaces.

### Examples

Procedure Test

Integer iCounter

End_Procedure  // Test

This example declares 1 integer variable named iCounter.

Integer i iCounter iCustomers

This example declares 3 integer variables named i, iCounter and iCustomers.

Integer[] iStudentIds

This example declares 1 dynamic array variable, named iStudentIds, containing an undefined number of elements of type integer.

Integer[5] iStudentIds

This example declares 1 static array variable, named iStudentIds, containing 5 of elements of type integer.

Integer[][3] iColors

This example creates a two-dimensional dynamic array variable named iColors, containing an undefined number of elements of type integer. Conceptually, this represents a rectangular array with an undefined number of rows, each of 3 columns.

You can declare dynamic multi-dimensional arrays where all dimensions are dynamic; these are called jagged arrays.

### Notes

• You may do calculations with integers, but any decimal values that results will be truncated without report of error.

• Use the Move command to initialize the value of an integer. For example;

Integer iCounter

Move 0 to iCounter

• Using global variables is discouraged. The maximum number of global integers you can declare is 32767, which are used for classes (1 global integer is used for each class) and global integers.

• If you need to define a global Integer variable, you should use the global_variable command to do so.