Throw

From Mesham
Revision as of 16:13, 31 December 2009 by Polas (talk | contribs) (Created page with '== Syntax == throw errorstring; == Semantics == Will throw the error string, and either cause termination of the program or, if caught by a try catch block, will be dealt with…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

throw errorstring;

Semantics

Will throw the error string, and either cause termination of the program or, if caught by a try catch block, will be dealt with.

Example

try
{
   throw "an error"
} catch "an error" {
   print["Error occurred!\n"];
};

In this example, a programmer defined error an error is thrown and caught.