Command to test if a variable has been defined? (universe specifically)

46 views
Skip to first unread message

George Gallen

unread,
Apr 20, 2022, 2:38:32 PM4/20/22
to mvd...@googlegroups.com
is there a way for subroutine to determine if a variable has been defined in the calling program?
so you don't get the run time error if you were to just do IF VAR="" THEN ....

example:
calling program
    CALL SOMESUB(VAR1, VAR2)

subroutine
   SUBROUTINE SOMESUB(VAR1, VAR2)
   VAR2=""
   IF VAR1="" THEN RETURN

But if in the calling program, there was no VAR1="..." , the subroutine will throw a run time error that "" was used.
is there a way like the php  isset()  function to test if a variable has been defined?

George

George Gallen

unread,
Apr 20, 2022, 2:45:58 PM4/20/22
to mvd...@googlegroups.com
OK - Found it.

ASSIGNED()

IF ASSIGNED(VAR1)=0 THEN RETURN

George

From: mvd...@googlegroups.com <mvd...@googlegroups.com> on behalf of George Gallen <g_ga...@hotmail.com>
Sent: Wednesday, April 20, 2022 2:38 PM
To: mvd...@googlegroups.com <mvd...@googlegroups.com>
Subject: [mvdbms] Command to test if a variable has been defined? (universe specifically)
 
--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/BL0PR13MB4516CB0301E0155D222C5468FAF59%40BL0PR13MB4516.namprd13.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages