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

-----------------------------------
Returns relative line number of executing program.
Return value - Numeric
-----------------------------------

This function returns the number of the line being executed in a
program.  Program lines are counted starting from the top of the
program, and comment lines, continuation lines and blank lines are
included in the line number count.  If a program is paused during
execution, LINENO() returns the number of the program line where
execution was paused.

By default, line numbers are returned relative to the beginning of the
main program.  If a procedure is called, the line numbering continues
from the top of the calling program.

1
        To return the line number relative to the top of the current program or
procedure, include the optional argument 1.  LINENO() is useful for
debugging programs.  You may set a breakpoint to stop program execution
at a specific line number by specifying:

                LINENO() = <expN>

        in the Debug window, and when the value of LINENO() is equal to <expN>,

+---------------------------------+
|         Program Example         |
+---------------------------------+
This is an example (segment) of a simple error handling routine.

ON ERROR DO bug_proc WITH LINENO()

*** Bug_Proc error handler ***
PROCEDURE bug_proc
PARAMETERS badline
DEACTIVATE WINDOW ALL
@ 23,10 SAY 'Error occurred at line:' + STR(badline)
SUSPEND
* many more statements

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

See Also:  ERROR(), MESSAGE(), PROGRAM(), SYS(16) Executing program name

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

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