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> <strong>Programming</strong> <strong>Language</strong><br />

if I eq N.DATASET+1<br />

create a SAMPLE called S<br />

file S last in DATASET<br />

else<br />

let S = F.DATASET<br />

for J = 1 to I-1,<br />

let S = S.DATASET(S)<br />

always<br />

let VALUE(S) = A<br />

return<br />

end<br />

_______________________________________________________________________________<br />

6.11 Monitored Variables<br />

Thus far, program names representing data values have had either memory locations or routines associated<br />

with them. Names defined as variables referred to values stored in computer words.<br />

Names defined as functions referred to values computed or stored by associated programs.<br />

A new data type, a monitored variable, has both a storage location and a function routine associated<br />

with it. The statements required to define and use monitored variables parallel the statements required<br />

to define variables and functions and to implement left-handed functions.<br />

Any variable, array, or attribute is defined as monitored by a statement of the form:<br />

or<br />

or<br />

define name as a variable monitored on the left<br />

define name as a variable monitored on the right<br />

define name as a variable monitored on the right and left<br />

The word the before right and left is optional.<br />

Because monitored variables have data values as well as routines associated with them, mode and<br />

dimensionality declarations can also be included, as in:<br />

define X as a real, 2-dimensional array monitored<br />

on left and right<br />

Monitoring on the right and on the left is obtained through function routines similar to right- and<br />

left-handed functions. If a variable is declared as monitored on the right (or left), a right-handed (or<br />

left-handed) monitoring routine must be provided. A routine is able to perform a monitoring function<br />

by the inclusion of one new executable statement. The statement differs, depending on whether<br />

the routine is right- or left-handed.<br />

282

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

Saved successfully!

Ooh no, something went wrong!