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.

Modelling Concepts<br />

F.KENNEL<br />

L.KENNEL<br />

N.KENNEL<br />

FARM<br />

3<br />

LICENSE<br />

P.KENNEL<br />

S.KENNEL<br />

M.KENNEL<br />

1 2 3<br />

0<br />

0<br />

LICENSE<br />

248<br />

P.KENNEL<br />

S.KENNEL<br />

M.KENNEL 0<br />

LICENSE<br />

DOG<br />

567<br />

P.KENNEL<br />

S.KENNEL<br />

0<br />

M.KENNEL 0<br />

Figure 4-16. Entity Records<br />

Entities are removed from sets by remove statements. Two basic forms of removal are possible.<br />

1a. remove first variable from set<br />

1b. remove last variable from set<br />

2. remove arithmetic expression from set<br />

The word the is optional after remove, as is either of the words the and this before the set name.<br />

In addition, either of the words this or above can be used before the expression in form (2).<br />

A remove first or remove last statement removes from a set the entity pointed to by the first<br />

or last pointer attribute of the set owner. The identification number of the removed entity is assigned<br />

to the variable in the remove statement. For instance, in the situation shown in figure 4-19,<br />

the statement:<br />

remove the first HOUND from KENNEL(FARM)<br />

removes the first entity (MYDOG) from KENNEL(FARM), makes the second entity first, and puts a<br />

pointer to MYDOG in HOUND. The attribute values of MYDOG, which now can also be called HOUND,<br />

157

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

Saved successfully!

Ooh no, something went wrong!