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

The variables PRICE and ITEMS appearing in the following print statements are assumed to have<br />

the values 100.899 and 27, respectively:<br />

1. print 1 line with PRICE/ITEMS thus<br />

PRICE/ITEM = $*.***<br />

is printed as:<br />

PRICE/ITEM = $3.737<br />

2. print 1 line with PRICE/ITEMS as follows<br />

PRICE/ITEM = $*.**<br />

is printed as:<br />

PRICE/ITEM = $3.74<br />

3. print 3 lines with PRICE, ITEMS, PRICE/ITEMS thus<br />

PRICE = $***.*<br />

ITEMS = *<br />

PRICE/ITEM = $*.***<br />

is printed as:<br />

PRICE = $100.9<br />

ITEMS = 27<br />

PRICE/ITEM = $3.737<br />

When several values are to be printed contiguously, the single parallel (|) is used in place of an asterisk<br />

to terminate a format on the left. If this is not done, two contiguous formats merge into one<br />

another. Thus, two contiguous three-digit integer fields can be expressed as ***|**, and six contiguous<br />

one-digit integer fields as ||||||.<br />

Blank lines can be included in the print format lines, or the skip statement may be used. If E is<br />

any arithmetic expression, the statement:<br />

skip E output lines<br />

skips a number of lines equal to the value of E rounded to an integer. The word output is optional.<br />

The words line and lines are synonymous. Some examples of the usage are:<br />

skip 1 output line<br />

skip N lines<br />

skip X + 3 * Y output lines<br />

If E is negative, it is treated as zero. At most, one complete page will be skipped.<br />

Pages can be ejected before printing, so that the next print statement starts at the top of a new<br />

page, by using the statement:<br />

8

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

Saved successfully!

Ooh no, something went wrong!