| ERROR | |||||||||||||||||||||||||||||||||||||
| Syntax | CATCH "ERROR |
||||||||||||||||||||||||||||||||||||
| Explanation | ERROR is the error object used by the error handling mechanism. See also CATCH and THROW.
When you catch an error, the system variable ERROR contains a short word describing the error that occured. This variable is only set when a procedure is running. At toplevel, the variable contains the empty list []. Use these values to throw certain types of runtime errors.
The system variable ERRORTEXT contains the text which Logo would otherwise have printed. This variable is only set when a procedure is running. At toplevel, the variable contains the empty list []. |
||||||||||||||||||||||||||||||||||||
| Examples | HELLO HELLO is neither a procedure nor a name TO CATCH.ERROR CATCH "ERROR [HELLO] PRINT LIST "|Code: | :ERROR PRINT LIST "|Text: | :ERRORTEXT END CATCH.ERROR defined. CATCH.ERROR Code: ACCESS Text: HELLO is neither a procedure nor a name |
||||||||||||||||||||||||||||||||||||