6. Embedded QUEL for BASIC : BASIC Variables and Data Types : Variable Usage
 
Share this page                  
Variable Usage
BASIC variables declared to EQUEL can substitute for most elements of EQUEL statements that are not keywords. Of course, the variable and its data type must make sense in the context of the element. To use a BASIC variable in an EQUEL statement, just use its name. To refer to an element, such as a database column, with the same name as a variable, dereference the element with the EQUEL dereferencing indicator (#). As an example of variable usage, the following retrieve statement uses the variables "namevar" and "numvar" to receive data, and the variable "idnovar" as an expression in the where clause:
##   retrieve (namevar = e.name, numvar = e.num)
##             where e.idno = idnovar;
You must verify that the statement using the variable is in the scope of the variable's declaration. Various rules and restrictions apply to the use of BASIC variables in EQUEL statements. The sections below describe the usage syntax of different categories of variables and provide examples of such use.