Top
Back: 5.1.23 eval
Forward: 5.1.25 example
FastBack: 5. Functions and system variables
FastForward: 6. Tricks and pitfalls
Up: 5.1 Functions
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

5.1.24 ERROR

Syntax:

ERROR ( string_expression )

Type:

none

Purpose:

Immediately interrupts the current computation, returns to the top-level, and displays the argument string_expression as error message.

Note:

This should be used as an emergency, resp. failure, exit within procedures.

Example:
 
int i=1;
proc myError() {ERROR("Need to leave now");i=2;}
myError();
→    ? Need to leave now
→    ? error occurred in line 2: `ERROR("Need to leave now");i=2;`
→    ? leaving ::myError
→    skipping text from `;` error at token `)`
i;
→ 1

Top Back: 5.1.23 eval Forward: 5.1.25 example FastBack: 5. Functions and system variables FastForward: 6. Tricks and pitfalls Up: 5.1 Functions Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.