Icon+Unicon/Intro: Difference between revisions

Line 278:
Terminates the current program and writes the result of expression to a file (&errout by default).
====error trapping====
The keyword '&error' is normally zero, but if set to a positive value, this sets the number of fatal errors that are tolerated and(i.e. converted to expression failure;). the The value of &error is decremented ifeach time this happens. Therefore the now-common TRY-CATCH behaviour can be written as:
 
Various idiomatic simplifications can be applied depending on your needs.
 
====error throwing====
Errors can be thrown using the function runerr(number, variable)
Anonymous user