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

read DATA<br />

if DATA > 10<br />

add DATA to DATA.GT.10<br />

jump ahead<br />

otherwise<br />

if DATA > 5<br />

add DATA to DATA.GT.5<br />

jump ahead<br />

otherwise<br />

add DATA to DATA.LS.5<br />

here<br />

The usefulness of this label-free capability becomes particularly apparent when coupled with the<br />

text substitution feature of <strong>SIMSCRIPT</strong> <strong>II.5</strong>. Consider the following example of a program written<br />

for interactive terminal execution:<br />

preamble<br />

normally mode is integer<br />

substitute these 7 lines for INPUT<br />

here if mode is not integer<br />

print 1 line thus<br />

PLEASE USE NUMERIC VALUE<br />

skip 1 field<br />

jump back<br />

otherwise<br />

read<br />

.<br />

.<br />

end<br />

main<br />

input LAMBDA<br />

.<br />

.<br />

input MU<br />

.<br />

.<br />

Each substitution for input contains a label-free jump when the program text is fully expanded.<br />

6.4 Attribute Definitions: Packing and Equivalence<br />

It has been assumed thus far that all data values are stored individually in separate and distinct computer<br />

locations. Occasionally, to minimize storage space requirements, it may be desirable to share<br />

storage locations between more than one variable. This may be done in two ways: If the ranges of<br />

values of the variables are limited in magnitude, a single location may be divided between several<br />

variables. If certain variables are known to be of importance only at nonconcurrent times during<br />

260

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

Saved successfully!

Ooh no, something went wrong!