throw | |||||||
Type | control structure | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Summary | Returns an error message to a control structure. | ||||||
Introduced | 1.0 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Parameters |
| ||||||
Example |
| ||||||
Related | Keyword: string, catch Message: errorDialog Function: commandNames Glossary: return, call, handler, execute, statement, message, negative, control structure, parameter, command, object Control Structure: return, try | ||||||
Description | Use the throw control structure in a handler called from within a try control structure. Form: The throw statement appears on a line by itself, anywhere inside a handler. If LiveCode generates the error (for example, an execution error from a built-in command), it returns a positive number to the try control structure. To avoid confusion, therefore, a throw control structure should return a negative number, or a non-numeric string. If a throw control structure is executed in a handler that was not called from within a try control structure, an errorDialog message is sent to the object, and the errorString is passed as a parameter.
|