[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|       SYS(16 [, <expN>])        |
+---------------------------------+

-----------------------------------
Returns the name of the program being executed.
Return value - Character
-----------------------------------

This function is useful when recovering from errors.  It is similar to
the PROGRAM() function, although SYS(16) returns a full path
specification and program name whereas PROGRAM() returns just the
program name.  If the program being executed is a PROCEDURE or FUNCTION,
SYS(16) also returns the name of the procedure file -- PROGRAM() does
not.

<expN>
        The optional numeric argument <expN> indicates from how many levels
back the program name is to be fetched.  This value can range from 1 to
N, where N is the depth to which the DO's have been nested to get to the
current program.  A parameter value of 1 or 0 returns the name of the
master program (the program first DOne).  If the parameter is omitted,
the name of the currently executing program is returned.  If the
parameter exceeds the nesting depth, the null string is returned.

+---------------------------------+
|         Program Example         |
+---------------------------------+
A complete execution traceback can be generated with this example.

STORE 1 TO i
DO WHILE LEN(SYS(16,i)) <> 0
        ? SYS(16,i)
        STORE i+1 TO i
ENDDO

-----------------------------------

See Also:  LINENO(), ON ERROR, PROGRAM(), SYS()

-----------------------------------

See Also: LINENO() ON ERROR PROGRAM() SYS()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson