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.

Example<br />

Syntax<br />

PROC add_matrix(VAR num array1{*,*,*}, num array2{*,*,*})<br />

IF Dim(array1,1) Dim(array2,1) OR Dim(array1,2) Dim(array2,2) OR<br />

Dim(array1,3) Dim(array2,3) THEN<br />

TPWrite "The size of the matrices are not the same";<br />

Stop;<br />

ELSE<br />

FOR i1 FROM 1 TO Dim(array1, 1) DO<br />

FOR i2 FROM 1 TO Dim(array1, 2) DO<br />

FOR i3 FROM 1 TO Dim(array1, 3) DO<br />

array1{i1,i2,i3} := array1{i1,i2,i3} + array2{i1,i2,i3};<br />

ENDFOR<br />

ENDFOR<br />

ENDFOR<br />

ENDIF<br />

RETURN;<br />

ENDPROC<br />

Two matrices are added. If the size of the matrices differs, the program stops and<br />

an error message appears.<br />

This procedure can take any three-dimensional arrays of data type num as an<br />

input.<br />

Dim ’(’<br />

[ArrPar’:=’] ’,’<br />

[DimNo’:=’] ’)’<br />

A REF parameter requires that the corresponding argument be either a constant, a variable<br />

or an entire persistent. The argument could also be an IN parameter, a VAR<br />

parameter or an entire PERS parameter.<br />

A function with a return value of the data type num.<br />

Related information<br />

Described in:<br />

Array parameters <strong>Basic</strong> <strong>Characteristics</strong> - Routines<br />

Array declaration <strong>Basic</strong> <strong>Characteristics</strong> - Data<br />

9-Dim-2 <strong>RAPID</strong> Reference Manual

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

Saved successfully!

Ooh no, something went wrong!