INTEGER

Contents


Integer is used to declare long integer type variables.

 

Syntax

   [ Local | Global | Extern ] Integer list_var_dim

Parameters

Element

Description

Restrictions

list_var_dim

List ofvar_dim separated by the character ','.

None.

var_dim

Name of a variable expressed in one of the following forms:
nom_var
nom_var '(' list_dim ')'

None.

nom_var

nom_de_variable.

None.

list_dim

List ofexp_dim separated by ','

Number limited to 4

exp_dim

Integer expression representing the number of elements in the variable from 0 to exp_dim-1) or 2 integer expressions separated by the 2 characters '..' representing the range of possible indices for variable

The number of elements must belong to [1,65535]. If a range is given the starting index should belong to
[-32768,32767].

 

Examples

   # Declaration of a local variable
   Local
Integer LOCLNG

   # Declaration of an external 8 element table (numbered 0 to 7)
   Extern Integer TABLNG( 8 )

   # Declaration of an 8 element table (numbered 1 to 8)
   Integer TABLNG( 1..8 )

   # Declaration of an 8 element table (numbered I to I+7)
   I = 3
  
Integer TABLNG( I .. I+7 )

   # Declaration of a 4-dimensional matrix
   Integer COORD( I, J, K, L)

 

Description and comments

Integer is used to declare long integer type variables, scaling them if necessary.

If Local is used, the variables will be local to the routine or sub-programme, and deleted when the sub-programme or routine is completed.

If Extern is used, the variable is not created, but its existence and type are checked.

If Extern is not used, a declaration of a variable already existing in class [V] or [L] will cause this variable to be deleted, followed by its recreation with the dimensions and type given. After a declaration, the variable is always initialised (that is, set to 0 for a variable of type Integer, for all indices of the variable).

Values for Integer are between -2E31 and 2E31-1.

 

Associated errors

Error

Description

ERDIM (55)

Too many dimensions are given (>4).

ERVARI ( 6)

Non-existent variable (Extern).

ERMODE (10)

- The dimensions given are not numerical.
- The type of variable is incorrect (Extern).

ERCLAS ( 7)

Non-existent or prohibited class (for example: declaration of a variable in a mask).

ERINDI ( 8)

One of the dimensions is null.

ERDOM (50)

The dimensions are not between -32768 and +32767.

 

Associated key words

SHORTINT - DECIMAL - CHAR - DATE - LIBELLE - GLOBAL - LOCAL - EXTERN


CONTENTS


Copyright © Sage 1999 - 2007