6. Embedded QUEL for BASIC : BASIC Variables and Data Types : Variable and Type Declarations : The Declare Statement
 
Share this page                  
The Declare Statement
The declare statement for an EQUEL/BASIC variable has the following syntax:
declare type identifier [(dimensions)] {[typeidentifier [(dimensions)]}
The declare statement for an EQUEL/BASIC constant has the syntax:
declare type constant identifier = literal {identifier = literal}
Syntax Notes:
1. If the word constant is specified, the declared constants cannot be targets of Ingres retrievals.
2. The type must be a BASIC type acceptable to EQUEL or, in the case of variables only, a record type 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.
3. 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.
4. You cannot use the declare statement to declare def functions to EQUEL.
The following example illustrates the use of the declare statement:
##   declare integer enum, eage, string ename
##   declare single constant minsal = 12496.62
##   declare real esal(100)
##   declare word null_ind     ! Null indicator