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.

Advanced Topics<br />

The generation of specific set routines can also be suppressed to conserve memory space when their<br />

associated operations are not used in a program. To do so, a list of the set operation codes, shown<br />

in table 6-5, is attached to a define set statement in the following form:<br />

,without set operation code list routines<br />

The comma is optional. A typical program might contain the statement:<br />

define QUEUE as a FIFO set without P and N<br />

attributes and without FB, FA and RS routines<br />

Table 6-5. Set Operation-Set Attribute Relationships<br />

Set Operation<br />

Mneumonic<br />

Set Name Prefix<br />

Required Set<br />

Attribute<br />

FF T. F,S<br />

FL U. F,L,S<br />

FB V. F,S,P<br />

FA W. F,S<br />

RF X. F,S<br />

RL Y. F,L,S,P<br />

RS Z. F,S,P<br />

In unusual cases, where the programmer wants to use set-type statements but wants to provide his<br />

own set operation routines, all seven routines can be deleted. The codes F and R delete the four file<br />

and three remove routines, respectively. A complete range of set specifications is thus possible.<br />

Mere mention of a set name in every statements calls for all three set attributes for the owner and<br />

member entities and all seven set routines. Additional definition in a define set statement can<br />

selectively delete set attributes and set routines. The extreme statement:<br />

define set as a set without F,L,P,S,M and N<br />

attributes without F and R routines<br />

removes all mechanisms that make set operations possible.<br />

6.10 Left-Handed Functions<br />

Functions are normally used in a "right-handed" manner. That is, they are referenced as on the<br />

right-hand side of an assignment operator, where they return a single value computed from a<br />

number of given arguments. An example of a right-handed <strong>SIMSCRIPT</strong> <strong>II.5</strong> function is the use of<br />

279

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

Saved successfully!

Ooh no, something went wrong!