Throw

From Mesham
Revision as of 15:44, 15 April 2019 by Polas (talk | contribs) (5 revisions imported)
(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

#include <io>
function void main() {
   try {
      throw "an error"
   } catch "an error" {
      print("Error occurred!\n");
   };
};

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

Since: Version 0.5