09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

simply considered to be omitted. Note that the specified parameter must be optional.<br />

Example: PROC Read_from_file (iodev File \num Maxtime)<br />

..<br />

character:=ReadBin (File \Time?Maxtime);<br />

! Max. time is only used if specified when calling the routine<br />

! Read_from_file<br />

..<br />

ENDPROC<br />

The parameter list of a function assigns an access mode to each parameter. The access<br />

mode can be either in, inout, var or pers:<br />

- An IN parameter (default) allows the argument to be any expression. The called<br />

function views the parameter as a constant.<br />

- An INOUT parameter requires the corresponding argument to be a variable<br />

(entire, array element or record component) or an entire persistent. The called<br />

function gains full (read/write) access to the argument.<br />

- A VAR parameter requires the corresponding argument to be a variable (entire,<br />

array element or record component). The called function gains full (read/write)<br />

access to the argument.<br />

- A PERS parameter requires the corresponding argument to be an entire persistent.<br />

The called function gains full (read/update) access to the argument.<br />

7.7 Priority between operators<br />

The relative priority of the operators determines the order in which they are evaluated.<br />

Parentheses provide a means to override operator priority. The rules below imply the<br />

following operator priority:<br />

* / DIV MOD - highest<br />

+ -<br />

< > = =<br />

AND<br />

XOR OR NOT - lowest<br />

An operator with high priority is evaluated prior to an operator with low priority. Operators<br />

of the same priority are evaluated from left to right.<br />

Example<br />

Expression Evaluation order Comment<br />

a + b + c (a + b) + c left to right rule<br />

a + b * c a + (b * c) * higher than +<br />

a OR b OR c (a OR b) OR c Left to right rule<br />

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

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

Saved successfully!

Ooh no, something went wrong!