Difference between revisions of "DOLEVEL()"
From Lianjapedia
Yvonne.milne (Talk | contribs) (→Description) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to return the 'do' level of the currently executing program or procedure | Function to return the 'do' level of the currently executing program or procedure | ||
− | |||
==Syntax== | ==Syntax== | ||
DOLEVEL() | DOLEVEL() | ||
− | |||
==See Also== | ==See Also== | ||
− | + | [[LEVEL()]], [[PATH()]], [[PROCLIBS()]], [[PROCLINE()]], [[PROCNAME()]], [[PROGRAM()]], [[SYS()]] | |
− | + | ||
==Description== | ==Description== | ||
− | The DOLEVEL() function returns the 'do' level of the currently executing program or procedure. Issued at the command prompt, the DOLEVEL() function returns | + | The DOLEVEL() function returns the 'do' level of the currently executing program or procedure. Issued at the command prompt, the DOLEVEL() function returns 1. Issued in a master or calling program, DOLEVEL() returns 2. Subsequent called programs or procedures are at a 'do' level based on the program nesting. |
− | + | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
> ? dolevel() | > ? dolevel() | ||
− | + | 1 | |
//master.prg | //master.prg | ||
procedure subproc1 | procedure subproc1 | ||
Line 29: | Line 25: | ||
//end of master.prg | //end of master.prg | ||
> do master | > do master | ||
− | |||
2 | 2 | ||
+ | 3 | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Latest revision as of 09:06, 1 December 2021
Contents
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 1. Issued in a master or calling program, DOLEVEL() returns 2. Subsequent called programs or procedures are at a 'do' level based on the program nesting.
Example
> ? dolevel() 1 //master.prg procedure subproc1 ? dolevel() ? return ? dolevel() subproc1() //end of master.prg > do master 2 3