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>Programming</strong> <strong>Language</strong> Concepts<br />

illustrate a simple report section that merely marks off a controlled output statement. That report<br />

section prints N lines containing two values each. If the output report is to be labeled, the program<br />

can be written as:<br />

begin report<br />

print 1 line as follows<br />

I X(I)<br />

for I = 1 to N,<br />

print 1 line with I, X(I) as follows<br />

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

end<br />

1 2 3 4 ..........................50<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

PAGE 1 PAGE 3<br />

51 52 ...........................100<br />

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

7<br />

PAGE 2 PAGE 4<br />

1 2 3 4 ..........................50 51 52 ...........................100<br />

1 8<br />

2<br />

9<br />

3<br />

4<br />

10<br />

5<br />

11<br />

12<br />

6<br />

7<br />

Figure 3-1. Report Using Row and Column Repetition<br />

A heading is printed above the N lines of output that identify the displayed values. If N is large and<br />

the output continues on more than one page, only the results on the first page are labeled. All other<br />

pages are untitled.<br />

A heading section may be defined within a report section so that titles are printed and any necessary<br />

computation performed whenever a page is ejected. A heading section is started by the statement<br />

begin heading and ended by the statement end. All statements between a begin heading and<br />

its matching end are executed whenever a page is ejected by an output statement within an<br />

enclosing report section, but after the heading section itself.<br />

125

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

Saved successfully!

Ooh no, something went wrong!