09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RAISE Calls an error handler<br />

Example<br />

Arguments<br />

RAISE is used to create an error in the program and then to call the error handler of the<br />

routine. RAISE can also be used in the error handler to propagate the current error to<br />

the error handler of the calling routine.<br />

This instruction can, for example, be used to jump back to a higher level in the structure<br />

of the program, e.g. to the error handler in the main routine, if an error occurs at a lower<br />

level.<br />

IF ...<br />

IF ...<br />

IF ...<br />

RAISE escape1;<br />

.<br />

ERROR<br />

IF ERRNO=escape1 RAISE;<br />

The routine is interrupted to enable it to remove itself from a low level in the program.<br />

A jump occurs to the error handler of the called routine.<br />

RAISE [ Error no. ]<br />

Error no. Data type: errnum<br />

Program execution<br />

Error number: Any number between 1 and 90 which the error handler can use to<br />

locate the error that has occurred (the ERRNO system variable).<br />

Error number must be specified outside the error handler in a RAISE instruction<br />

in order to be able to transfer execution to the error handler of that routine.<br />

If the instruction is present in a routine’s error handler, the error number may not<br />

be specified. In this case, the error is propagated to the error handler of the calling<br />

routine.<br />

Program execution continues in the routine’s error handler. After the error handler has<br />

been executed, program execution can continue with:<br />

- the routine that called the routine in question (RETURN),<br />

- the error handler of the routine that called the routine in question (RAISE).<br />

<strong>RAPID</strong> Reference Manual 8-RAISE-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!