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

-----------------------------------
Returns name of program being executed or program that was executing
when error occurred.
Return value - Character
-----------------------------------

PROGRAM() returns the name of the program currently being executed or
the program that was executing when an error occurred.  This function is
useful when recovering from errors.  It is similar to SYS(16).

<expN>
        <expN> specifies how many levels back the program name is to be
fetched.  This parameter can range from 0 to the program nesting depth.
Programs may be nested (a program can execute another program which can
execute another program ... ) to 32 levels.

        Including 0 or 1 in <expN> returns the name of the master program (the
program first executed).  If <expN> is omitted, the name of the
currently executing program is returned.  If <expN> exceeds the program
nesting depth, the null string is returned.

+---------------------------------+
|         Program Example         |
+---------------------------------+
ON ERROR DO errhand WITH PROGRAM()

* This line will generate an error
USE nodatabase

PROCEDURE errhand
PARAMETERS mprogram

WAIT 'An error occurred in the program ' + mprogram WINDOW

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

See Also:  LINENO(), SYS(16) Executing program name

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

See Also: LINENO() SYS(16) Executing program name
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson