Error getting tags :
error 404Error getting tags :
error 404 throw | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
throw
Basics
Expander triangle
Type
Control Structure
Syntax

throw errorString

Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns an error message to a control structure.
Examples

open file tFile for text read
if the result is not empty then
throw "failed_to_open_file"
end if

Additional Comments
Expander triangle

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.

Parameters:

The errorString is the string that is returned to the calling try control structure. The errorString becomes the parameter of the catch lin in the try control structure.

Comments:

If Revolution 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.

Note: The throw control structure is implemented internally as a command and appears in the commandNames.

User Comments
Expander triangle