DOLEVEL()

From Lianjapedia
Revision as of 08:00, 25 November 2011 by Lianjasupport (Talk | contribs)

Jump to: navigation, search

Purpose

Function to return the 'do' level of the currently executing program or procedure

Syntax

DOLEVEL()

See Also

LEVEL(), PATH(), PROCLIBS(), PROCLINE(), PROCNAME(), PROGRAM(), SYS()

Description

The DOLEVEL() function returns the 'do' level of the currently executing program or procedure. Issued at the command prompt, the DOLEVEL() function returns 0. Issued in a master or calling program, DOLEVEL() returns 1. Subsequent called programs or procedures are at a 'do' level based on the program nesting.

Example

> ? dolevel()
         0
//master.prg
procedure subproc1
? dolevel()
?
return
 
? dolevel()
subproc1()
//end of master.prg
> do master
         1
         2