RobertB
4th May 2005, 16:31
Hi all,

is it possible within a script to read/output program line-numbers? - for instance, when an error occurs in the program, a message could be displayed showing on which line the error occurred.

R

NPRao
4th May 2005, 20:24
Refer to the predefined variable -
long dal.error.line R
The line number in the code where the last dal.set.error.message was called. See dal.error.file above.
Also refer to the links, I have never explored this one.
Pragma codes (preprocessor) (http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_pragma_codes_preprocessor)
#pragma fatal <text> The programmer generates his own error.
Conditional compiling (preprocessor) (http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_conditional_compiling_preprocessor)
* The following keywords provide debug information in 3GL sources:

FILE : contains the name of the current source
LINE : contains the line number of the current source

For example:

message("This is at line %d in the source %s", LINE, FILE)