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

X = Y<br />

X ≥ Y<br />

X < Y<br />

X + Y = X * Y<br />

is false<br />

is true<br />

is false<br />

is false<br />

For readability in different contexts, <strong>SIMSCRIPT</strong> <strong>II.5</strong> provides alternative ways of writing logical<br />

expressions. Table 1-3 relates the mathematical symbol of each relational operator with keyboard<br />

symbols, English abbreviations, and "literary English" equivalents permitted in <strong>SIMSCRIPT</strong> <strong>II.5</strong><br />

comparisons.<br />

Unless the keyboard symbols (column 2, table 1-3) are used, each relational operator must be separated<br />

from the arithmetic expressions on either side by a parenthesis, or at least one blank.<br />

Typical logical expressions are:<br />

1. Y > O<br />

2. AGE less than RETIREMENT<br />

3. CODE not equal to ZIP<br />

4. LEVEL < THRESHOLD<br />

5. (FIXED + NUMBER * UNITS) greater than LOWBID<br />

6. A >= (B * X ** 2 + 3.57/C)<br />

7. (X ** 2 + Y ** 2) greater than Z ** 2<br />

8. X ** 2 + Y ** 2 > Z ** 2<br />

Examples 5, 6, and 7 demonstrate that the arithmetic expressions may be enclosed in parentheses<br />

for clarity without changing their meaning. Examples 7 and 8 illustrate the use of equivalent forms<br />

of a relational operator.<br />

11

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

Saved successfully!

Ooh no, something went wrong!