Determines if a variable is assigned.
||A user variable. If var is not a valid variable name, MVBasic issues a syntax error.
function determines whether a user variable is assigned or not assigned. If var
is assigned a value, ASSIGNED
returns 1. If var
is not assigned a value, ASSIGNED
returns 0. An assigned value can be a single value or a dynamic array value. ASSIGNED
also returns 1 if var
is assigned the empty string (""), or is assigned an unassigned variable.
The input var
can be a local variable, a global variable, or a process-private global variable. It can be with or without subscripts.
should not be used on system variables
(@ variables). It always returns 0 for all @ variables, whether or not the @ variable currently has a value.
statement initializes variables as unassigned in Caché MVBasic. Array variable initialization varies with different MultiValue emulations.
You can use the $KILL
statement to unassign variables.
The following example tests the assignment of several variables. ASSIGNED
returns 1 (assigned) for variables a
returns 0 (unassigned) for variable g
Note that variable f
is considered assigned, even though it is assigned to an unassigned variable.
© 1997-2019 InterSystems Corporation, Cambridge, MA