18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

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>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

Program 2-1.<br />

_______________________________________________________________________________<br />

preamble<br />

normally, mode is integer<br />

define V1 and V2 as real, 1-dimensional arrays<br />

define V3, V4 and V5 as 2-dimensional arrays<br />

normally, mode is real<br />

end<br />

main<br />

read N<br />

reserve V1,V2 as N, V3,V4,V5 as N by N<br />

read V1 and V2<br />

let V3(1,1) = V1(V2(1))<br />

:<br />

and other statements that make up a main routine,<br />

including calling references to the subprograms<br />

call PROCESS.DATA<br />

:<br />

call PRINTOUT<br />

:<br />

end '' of Main Routine<br />

routine PROCESS.DATA<br />

normally dimension is 1, mode is real<br />

define Z as an integer array<br />

normally dimension is 0<br />

define L, M and N as integer variables<br />

reserve Z as 10<br />

'START'<br />

for X = 1 to 10<br />

do...<br />

other statements that make up a routine<br />

:<br />

return<br />

end '' of Routine PROCESS.DATA<br />

routine PRINTOUT<br />

define Z as a 2-dimensional variable<br />

reserve Z as 10 by 5<br />

'START'<br />

let X = 1<br />

:<br />

return<br />

end '' of Routine PRINTOUT<br />

_______________________________________________________________________________<br />

58

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

Saved successfully!

Ooh no, something went wrong!