The UNASSIGNED() function tests whether a variable is unassigned.
All QMBasic variables except those in common blocks are initially unassigned. Any attempt to use the contents of the variable in an expression would cause a run time error until such time as a value has been stored in it. The UNASSIGNED() function allows a program to test whether a variable is unassigned, returning True if it is unassigned or False if it is assigned.
SUBROUTINE VALIDATE(ACCOUNT.CODE, ERROR)
ERROR = 1
CASE ACCOUNT.CODE MATCHES '3N-5N'
ERROR = 2
ERROR = 0
This program fragment validates an account code. The use of the UNASSIGNED() function prevents an abort if the variable has not been assigned.