Xbasic
ERROR_LINE_NUMBER_GET Function
Syntax
Line_Number as N = ERROR_LINE_NUMBER_GET([N SESSION])
Arguments
- SESSION
Numeric
Description
Report the line that the error occured on.
Discussion
Causes an error to occur and displays the Error description as the error text. ERROR_LINE_NUMBER_GET() returns the Line_Number of the command that caused the error in the script. You would generally use this command in the error handler portion of a script.
Example
Use this error handling routine to display the error message script name, and line number any run-time error that occurs.
error_handler:
err_msg = error_text_get(error_code_get() )
line = error_line_number_get()
script = error_script_get()
ui_msg_box("Error", err_msg + " Error occurred at line " + alltrim( str(line, 4, 0) ) + "in script: " + script)
RESUME NEXTSee Also