18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

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.

<strong>Programming</strong> <strong>Language</strong> Concepts<br />

6 7 8 9 10<br />

** ** ** ** **<br />

** ** ** ** **<br />

** ** ** ** **<br />

** ** ** ** **<br />

** ** ** ** **<br />

Figure 3-3. Column Repetition, Page 2<br />

Pages 3, 4, and 5 are similar, with page 3 using J = 11, ..., 15, and page 4 using J = 16,<br />

..., 20, etc.<br />

The index values are computed entirely within this version of the print statement. They are not<br />

individually accessible in any other statement and should not be referenced outside this context.<br />

The phrase a group of .. fields in a print statement notifies the compiler that a sequence<br />

of index values generated for the enclosing column repetition block is to be used in computing the<br />

output fields. As shown above, one format must be provided for each of the fields in the column<br />

repetition group. If the begin report statement specifies groups of six, then six formats must be<br />

provided in each print statement containing a a group of ... fields clause. For example,<br />

the previous displays can be better labeled by using the statement:<br />

for I = 1 to 6,<br />

print 1 line with I,<br />

and a group of X(I,J) fields as follows<br />

* ** ** ** ** **<br />

Several values can be alternated within a a group of ... fields clause, each using the index<br />

values. For example, the previous program might want to display both X(I,J) and Y(I,J) as follows:<br />

for I = 1 to 6,<br />

print 1 line with I,<br />

and a group of X(I,J), Y(I,J) fields as follows<br />

* ** *.* ** *.* ** *.* ** *.* ** *.*<br />

A format must be given for each output value, of course. All repeated formats must agree in mode.<br />

It is not possible to write:<br />

print 1 line with a group of I fields thus<br />

131

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

Saved successfully!

Ooh no, something went wrong!