Xbasic
ERROR_CODE_GET Function
Syntax
Error_Number as N = ERROR_CODE_GET()
Description
Retreive the last error code.
Discussion
ERROR_CODE_GET() returns the Error_Number of the most recent run-time error. If the last error was a DOS error, ERROR_CODE_GET() will return error number 1000. You can then use ERROR_TEXT_GET(2000) to obtain the corresponding DOS error message.
Example
on error goto display_error
'put Xbasic code here
'--------------------
end
display_error:
err = error_code_get()
msg = error_text_get(err)
ui_msg_box("Error", msg + str(err))
endSee Also