^PASSED

Determine whether an argument was passed

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
^PASSED(parameter)

Arguments

parameter

The routine parameter in question. (a or n)

Return value

If the specified argument has been passed to the current routine, ^PASSED returns a value of one. If the argument has not been passed, the returned value is zero. (i)

Discussion

^PASSED determines whether or not a routine argument has been passed.

Parameter can be specified as the field name of a parameter, or by using ^ARG(n_expression) or ^ARGN(n_expression).

If you call ^PASSED on a required parameter, a “^PASSED on required parameter is always true” warning (INVPASSED) will occur.

^PASSED cannot be present in a main routine.

Examples

subroutine sub
    arg1        ,a              ;Optional parameter
    arg2        ,a              ;Optional parameter
    arg3        ,a              ;Optional parameter
record
    i           ,d2
proc
    for i from 1 thru %numargs
      if (^passed(^arg(i)))
        .
        .   process argument(i)
        .