Errline Global Variable
See Also: Err, Error Command
Purpose
To identify the program command line on which an error was last triggered.
Type
Integer
What It Does
When a runtime error occurs, DataFlex moves the number of the program line on which the error occurred to errline. By using this value, you can provide error handling in your program that varies according to where in the program the error occurred.
if (errline = 23) Showln "Ignore this error"
This command would cause any error triggered on Line 23 of the program to be ignored.
Notes
-
You can use the
errlinenumber with move commands to trigger further messages and command sequences. -
The value of
errlinemay be compared to the number of the line on which a label is located, as long as the label has been executed at least once. The name of the label must be in parentheses. This is useful in error routines that you supply yourself (see On Error Command).if (errline > C_OBJECT_SECTION) abortIn this example, execution would end if an error were generated on a line below the constant
C_OBJECT_SECTION. -
The line number in
errlineis the compiled command line number, not the line count in your source code. A printout of the compile-time listing will enable you to identify line numbers in your program.