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 />

Table 4 shows the one operation possible.<br />

.<br />

7.4 Using data in expressions<br />

An entire variable, persistent or constant can be a part of an expression.<br />

Example: 2*pi*radius<br />

Arrays<br />

A variable, persistent or constant declared as an array can be referenced to the whole<br />

array or a single element.<br />

An array element is referenced using the index number of the element. The index is an<br />

integer value greater than 0 and may not violate the declared dimension. Index value 1<br />

selects the first element. The number of elements in the index list must fit the declared<br />

degree (1, 2 or 3) of the array.<br />

Example: VAR num row{3};<br />

VAR num column{3};<br />

VAR num value;<br />

.<br />

value := column{3}; only one element in the array<br />

row := column; all elements in the array<br />

Records<br />

Table 4<br />

Operator Operation Operand types Result type<br />

+ string concatenation string + string string<br />

A variable, persistent or constant declared as a record can be referenced to the whole<br />

record or a single component.<br />

A record component is referenced using the component name.<br />

Example: VAR pos home;<br />

VAR pos pos1;<br />

VAR num yvalue;<br />

..<br />

yvalue := home.y; the Y component only<br />

pos1 := home; the whole position<br />

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

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

Saved successfully!

Ooh no, something went wrong!