%ISLITERAL

Determine whether argument is a literal

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %ISLITERAL(argument)

Return value

status

One of the following values: (n)

1 = The passed‑in argument is a literal (or a runtime temp).

0 = The passed‑in argument is not a literal (or a runtime temp).

Arguments

argument

The argument to be checked. (a)

Discussion

%ISLITERAL is a ^VAL function. It simplifies the process of finding out whether a passed argument is a literal (instead of attempting to write to an argument and trapping an error to find out). On OpenVMS, this function can only determine writability.

Examples

The example below is a wrapper routine to delete a window. If the ID passed is in a variable, it clears the variable so the calling routine doesn’t try to use the ID later:

.include "DBLDIR:windows.def"
subroutine my_delete_window
    a_id        ,n      ;ID of window to delete
proc
    xcall w_proc(WP_DELETE, a_id)
    if (!%isliteral(a_id))
      clear a_id
    xreturn
end