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

Because an entity identification can itself be an attribute, as in the case of a pointer, nested entity<br />

references can be made, as in:<br />

S.KENNEL(F.KENNEL(FARM))<br />

which reads as "the successor of the first in KENNEL of FARM" and has the same value as<br />

S.KENNEL(DOG) because F.KENNEL(FARM) = DOG. Any level of entity nesting is possible as<br />

long as all nested expressions evaluate to entity identifiers.<br />

When a third DOG is created and filed, the entity records are as shown in figure 4-16. Additional<br />

creations and filings are analogous.<br />

A file last statement has an effect similar to file first, but operates on the opposite end of<br />

a set. If our example program segment were written with the statement file DOG last in<br />

KENNEL(FARM), after executing three creates and files the entity records would appear as in figure<br />

4-17.<br />

The file before and file after statements are described with a different example. Assume<br />

the entity record organization shown in figure 4-18 was created by the following program statements:<br />

create a DOG called MYDOG<br />

file MYDOG first in KENNEL(FARM)<br />

create a DOG called YOURDOG<br />

file YOURDOG first in KENNEL(FARM)<br />

The statements:<br />

create a DOG<br />

file the DOG after YOURDOG in KENNEL(FARM)<br />

insert the entity record for the newly created DOG after the entity record pointed to by the variable<br />

FIDO. The resulting entity record organization is shown in figure 4-19.<br />

156

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

Saved successfully!

Ooh no, something went wrong!