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

substitute these 2 lines for ZZ<br />

set VALUE = B<br />

go to START<br />

define SET to mean let<br />

define B to mean X(1)*Y(1)+1<br />

Program statement:<br />

if VALUE is greater than 0 ZZ<br />

Translation:<br />

ZZ is translated to:<br />

Compiled as:<br />

set VALUE = B<br />

go to START<br />

set VALUE = B is translated to<br />

let VALUE = B and then to<br />

let VALUE = X(1)*Y(1)+1<br />

if VALUE is greater than 0<br />

let VALUE=X(1)*Y(1)+1<br />

go to START<br />

Certain words, such as statement key words, should be redefined with extreme caution. If, for example,<br />

the word A is defined, as in the statement:<br />

define A to mean X<br />

and a define statement such as define LIST as a real array is processed, X will be substituted<br />

for A, and will create the incorrect statement define LIST as X real array.<br />

The effect of define to mean statements can be withdrawn by the statement:<br />

suppress substitution<br />

and reinstated by the statement:<br />

resume substitution<br />

These statements should be placed alone on program statement lines, because substitution takes<br />

place for an entire line as it is read, and before the contents are interpreted. If other statements appear<br />

on the same record as a suppress substitution statement, substitutions are made for<br />

such statements (if called for) before the suppress command is recognized. To suppress substitution<br />

for a particular word, the word itself is defined, as in the following example:<br />

83

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

Saved successfully!

Ooh no, something went wrong!