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.
assigned() can tell if common variables have been previously assigned.
assigned() 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.
This 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