SMALLINT

The SMALLINT data type is used for storing small whole numbers.

Syntax

SMALLINT

Usage

The storage of SMALLINT variables is based on 2 bytes of signed data ( = 16 bits ).

The value range is from -32,767 to +32,767.

SMALLINT variables can be initialized with integer literals:
MAIN
  DEFINE i SMALLINT
  LET i = 1234
  DISPLAY i 
END MAIN

Assigning a whole number that exceeds the SMALLING range raises overflow error -1214, which can be trapped with WHENEVER ANY ERROR or a TRY/CATCH block.

SMALLINT variables are initialized to zero in functions, modules and globals.

Data type conversion can be controlled by catching the runtime exceptions. For more details, see Handling type conversion errors.