Integer Data Type

Description

Integer variables are stored as 16-bit (2-byte) numbers ranging in value from -32,768 to 32,767. The type-declaration character for Integer is % (character code 37).

You can also use Integer variables to represent enumerated values. An enumerated value can contain a finite set of unique whole numbers, each of which has special meaning in the context in which it is used. Enumerated values provide a convenient way to select among a known number of choices. For example, when asking the user to select a color from a list, you could have 0 = black, 1 = white, and so on. It is good programming practice to define constants using the Const statement for each enumerated value.

See Also

CInt Function, Data Type Summary, Deftype Statements, Long Data Type, Variant Data Type.