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.

TRYNEXT Jumps over an instruction<br />

which has caused an error<br />

Example<br />

TRYNEXT is used to jump over an instruction which has caused an error. Instead, the<br />

next instruction is run.<br />

reg2 := reg3/reg4;<br />

.<br />

ERROR<br />

IF ERRNO = ERR_DIVZERO THEN<br />

reg2:=0;<br />

TRYNEXT;<br />

ENDIF<br />

Program execution<br />

Limitations<br />

Syntax<br />

An attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero),<br />

a jump is made to the error handler, where reg2 is set to 0. The TRYNEXT<br />

instruction is then used to continue with the next instruction.<br />

Program execution continues with the instruction subsequent to the instruction that<br />

caused the error.<br />

The instruction can only exist in a routine’s error handler.<br />

TRYNEXT’;’<br />

Related information<br />

Described in:<br />

Error handlers <strong>Basic</strong> <strong>Characteristics</strong>-<br />

Error Recovery<br />

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

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

Saved successfully!

Ooh no, something went wrong!