6. Embedded QUEL for BASIC : BASIC Variables and Data Types : Variable and Type Declarations : Static Storage Variable Declarations
 
Share this page                  
Static Storage Variable Declarations
EQUEL supports the BASIC common and map variable declarations. The syntax for a common variable declaration is as follows:
common com [(com_name)]
              type identifier [(dimensions)] [str_length]
              {[typeidentifier [(dimensions)] [str_length]}
The syntax for a map variable declaration is as follows:
map map dynamic (map_name) 
              type identifier [(dimensions)] [str_length]
              {[typeidentifier [(dimensions)] [str_length]}
Syntax Notes:
1. The type must be a BASIC type acceptable to EQUEL or 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.
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.
3. The string length, if present, must be a simple integer literal.
4. The com_name or map_name clause is not parsed by the EQUEL preprocessor. Consequently, the preprocessor will accept common and map areas of the same name in a single program module. It will also accept a map dynamic statement whose com_name has not appeared in another map statement. Either of these situations will later cause BASIC compiler errors.
The following example uses common and map variable declarations:
##   common (globals) string address = 30, integer zip
##   map (ebuf) byte eage, string ename = 20,     single
##             emp_num
##   common (globals) integer empid (200)