QTIPS - Guaranteed Variable Assignment
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Sprezzatura Ltd | 01 APR 1991 | 2.03+ | EXPERT | UNASSIGNED, GUAR_ASSIGN |
The system function UNASSIGNED (Vol 1 Issue 1) is most often used within a program to trap and assign to null, unassigned variables e.g.
DECLARE FUNCTION UNASSIGNED IF UNASSIGNED(X) THEN X= ""
A new system function GUAR_ASSIGN can be used to take the place of the above code. Passed a variable, it returns the value of the variable if it is assigned. or null if it is unassigned. i.e.
DECLARE FUNCTION GUAR_ASSIGN X = GUAR_ASSIGN(X)
(Volume 2, Issue 10, Page 3)