The assigned() function determines if the variable has been assigned a value.
assigned(var)
var | Variable to check for assignment. |
If var has an assigned value, a nonzero value (true) is returned. If no value is assigned, 0 (false) is returned.
The assigned() function determines if common variables have been previously assigned.
The assigned() function works well in BASIC subroutines called from the call AQL processing code. It prevents files from being repeatedly opened and variables from continually being re-initialized.
The following example determines if the file variable fv.entity has been assigned previously with the file statement. If it has not been assigned, the file statement is executed.
if not(assigned(fv.entity)) then file entity