Difference between revisions of "PROCLINE()"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to return currently executing line number | Function to return currently executing line number | ||
− | |||
==Syntax== | ==Syntax== | ||
PROCLINE([<expN>]) | PROCLINE([<expN>]) | ||
− | |||
==See Also== | ==See Also== | ||
− | [[ | + | [[ASTACKTRACE()]], [[FUNCTION]], [[LINENO()]], [[PROCEDURE]], [[PROCNAME()]], [[PROGRAM()]] |
− | + | ||
==Description== | ==Description== | ||
The PROCLINE() function returns the number of the current line being executed. This function is particularly useful in conjunction with the ON ERROR command. If the currently executing line is within a procedure or function within a multi-procedure/function program or library, the line number returned is relative to the program or library as a whole. If the optional <expN> evaluates to 1, the line number returned is relative to the individual procedure or function. In this case, the PROCEDURE or FUNCTION declaration is treated as line 0 and the first executable line as line 1. | The PROCLINE() function returns the number of the current line being executed. This function is particularly useful in conjunction with the ON ERROR command. If the currently executing line is within a procedure or function within a multi-procedure/function program or library, the line number returned is relative to the program or library as a whole. If the optional <expN> evaluates to 1, the line number returned is relative to the individual procedure or function. In this case, the PROCEDURE or FUNCTION declaration is treated as line 0 and the first executable line as line 1. | ||
− | |||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
m_procline = procline() | m_procline = procline() | ||
− | + | messagebox("The last line number is &m_procline") | |
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Latest revision as of 07:41, 8 January 2013
Contents
Purpose
Function to return currently executing line number
Syntax
PROCLINE([<expN>])
See Also
ASTACKTRACE(), FUNCTION, LINENO(), PROCEDURE, PROCNAME(), PROGRAM()
Description
The PROCLINE() function returns the number of the current line being executed. This function is particularly useful in conjunction with the ON ERROR command. If the currently executing line is within a procedure or function within a multi-procedure/function program or library, the line number returned is relative to the program or library as a whole. If the optional <expN> evaluates to 1, the line number returned is relative to the individual procedure or function. In this case, the PROCEDURE or FUNCTION declaration is treated as line 0 and the first executable line as line 1.
Example
m_procline = procline() messagebox("The last line number is &m_procline")