6. Embedded QUEL for BASIC : BASIC Variables and Data Types : Variable and Type Declarations : The Dimension Statement
 
Share this page                  
The Dimension Statement
The dimension statement can be used to declare arrays to EQUEL. Its syntax is:
dimension dim type identifier(dimensions{[typeidentifier (dimensions)}
Syntax Notes:
1. The type must be a BASIC type acceptable to EQUEL or a record already defined to EQUEL. Note that the type is mandatory for EQUEL declarations, because EQUEL has no notion of a default type. The type need only be specified once when declaring a list of variables of the same type.
2. The dimensions of an array specification are not parsed by the EQUEL preprocessor. Consequently, the preprocessor does not check bounds. Note also that an illegal dimension, such as a non-numeric value, will be accepted by the preprocessor, but will later cause BASIC compiler errors. Furthermore, EQUEL does not distinguish between executable and declarative dimension statements. If you have used the dimension statement to declare an executable array to EQUEL, using the EQUEL ## mark with subsequent executable dimension statements of the same array will cause a redeclaration error.
The following example illustrates the use of the dimension statement:
##  dim string employee_names(100,20)  ! declarative DIM statement
##  dimension long emp_id(100,2,2)
##  dimension double expenses(numdepts) ! executable DIM statement