Determine whether an argument was passed

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS



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)


^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.


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