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.

<strong>Basic</strong> <strong>Characteristics</strong> <strong>RAPID</strong> Routines<br />

with the degree of the corresponding formal parameter. The dimension of an array<br />

parameter is “conformant” (marked with “*”). The actual dimension thus depends on<br />

the dimension of the corresponding argument in a routine call. A routine can determine<br />

the actual dimension of a parameter using the predefined function, Dim.<br />

Example: PROC routine5 (VAR num pallet{*,*})<br />

3.3 Routine termination<br />

The execution of a procedure is either explicitly terminated by a RETURN instruction<br />

or implicitly terminated when the end (ENDPROC, BACKWARD or ERROR) of the<br />

procedure is reached.<br />

The evaluation of a function must be terminated by a RETURN instruction.<br />

The execution of a trap routine is explicitly terminated using the RETURN instruction<br />

or implicitly terminated when the end (ENDTRAP or ERROR) of that trap routine is<br />

reached. Execution continues from the point where the interrupt occurred.<br />

3.4 Routine declarations<br />

A routine can contain routine declarations (including parameters), data, a body, a backward<br />

handler (only procedures) and an error handler (see Figure 3). Routine declarations<br />

cannot be nested, i.e. it is not possible to declare a routine within a routine.<br />

Module<br />

Data declarations<br />

Routine a<br />

Routine b<br />

Routine c<br />

Routine d<br />

Routine e<br />

Routine declaration<br />

Data declarations<br />

Body (Instructions)<br />

Backward handler<br />

Error handler<br />

Figure 3 A routine can contain declarations, data, a body, a backward handler and an error<br />

handler.<br />

<strong>RAPID</strong> Reference Manual 5-13

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

Saved successfully!

Ooh no, something went wrong!