OnError (Continue)
Used as a scoping keyword, similar to WorkWith/End WorkWith
.
Description:
"Error Message Text"
Label:
Continue
Set the OnError state to one of the following options:
- "Error Message Text" -- The Procedure will exit and the specified text should be presented to the end user. This may be a quoted text string, or an expression.
- Label: -- The Procedure will jump to the Label, with the intent that the source code at this Label will handle the error condition or perform some clean up before exiting. The Label must not be in quotes and must end with a :
- Continue -- Runtime errors will be ignored so that results can be manually tested. Syntax and system errors however will still be caught. The word Continue should not be in quotes.
- When the OnError state is not set, or has been cleared with End OnError, all run time errors will result in debugging related details being presented to the end user.
It is important to note that Database Record related commands (New, Updated, Delete, Attach, Detach, etc...) will only result in a runtime error if there is a problem with the overall command, not an individual Record. To test for individual Record errors, the Error Field within the Query (which is created automatically if/when an error occurs) must be tested instead. A useful tool for this task is the [CountIf] TopQuery command, where an example is provided.