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>SIMSCRIPT</strong> <strong>II.5</strong> Basic Concepts<br />

or<br />

print I lines with arithmetic expression list as follows<br />

followed by I lines of descriptive text and format information. The line count I is a positive integer<br />

constant. The word line can be used instead of lines to improve readability. Thus and like<br />

this may be used as alternatives to the phrase. Some sample print statements are:<br />

print 2 lines as follows<br />

print 1 line thus<br />

print 2 lines with X and Y like this<br />

print 4 lines with X, X**2, Y, Y**2, X*Y, N as follows<br />

The I lines, called format lines, that follow the print statement can contain as many as 80 columns<br />

of textual information and formats for variables or arithmetic expressions whose values are to be<br />

printed. There can be either text, or formats, or both in any format line. The length of a format line<br />

is measured as the number of columns from column 1 to the last nonblank column in the line.<br />

Textual information appearing in format lines is printed exactly as it appears. Thus, the statement:<br />

print 1 line as follows<br />

......This is a Sample Format Line.....<br />

prints a single line of output containing the above message. The statement:<br />

print 2 lines thus<br />

Summary Report<br />

INCOME<br />

EXPENSE DATA<br />

prints two lines of output as they appear in the format lines. Any character except an (*) or a vertical<br />

bar (|) can appear in a format line as a textual message. Blanks are "printed" as empty columns.<br />

When print statements are used to display the value of arithmetic expressions, the expressions are<br />

listed in the print statement, and descriptive formats are provided for their values. The expressions<br />

are first evaluated, and then printed in the display formats in left-to-right order. The display<br />

formats are described using asterisk (*) characters to indicate the desired positioning of the printed<br />

values.<br />

The general format description for a numeric value is of the form ***.**, where the asterisks indicate<br />

the number of print positions before and after the decimal point. The decimal point and following<br />

asterisks may be omitted if no fractional part is to be printed. If necessary, the value is<br />

rounded before printing. Blank print positions to the left of the decimal point, although not filled<br />

with asterisks, may be used if required by the magnitude of the number. A complete list of print<br />

formats is given in Appendix A.<br />

7

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

Saved successfully!

Ooh no, something went wrong!