The check instruction is used to check (ensure) that a given condition is fulfilled.
If the checked condition is fulfilled then the script execution continues normally. If it is not fulfilled, the script execution stops immediately, and an error object is created and returned to the script caller.
The check instruction checks attributes, as well as command input and output conditions. Therefore, it can only be used in the following check scripts:
attribute_check script”check script”in_check script (see the section called “Command in_check script”out_check script (see the section called “Command out_check script”check script”check script”Table 8.23. check syntax
| Production | Syntax | Links |
|---|---|---|
check_instruction |
"check" condition error_info ?
| the section called “check instruction” |
condition |
| the section called “condition” |
error_info |
( "error_message" ":" expression ) ? ( "error_id" ":" identifier ) ? ( "error_data" ":" expression ) ?
| the section called “error info” |
condition is an expression of type yes_no that evaluates to yes if the condition is fulfilled. For more information see the section called “condition”
error_info is an optional clause used to return more specific error data if the condition is not fulfilled (e.g. a localized error message). For more information see the section called “error info”
See: