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

7. Declaration:<br />

every PERSON has an AGE(1/4), owns a FAMILY, has a<br />

(NAME(2/4) and WEIGHT (2/2))<br />

Entity structure:<br />

AGE<br />

NAME<br />

WEIGHT<br />

F.FAMILY<br />

L.FAMILY<br />

N.FAMILY<br />

Field and bit packing of integer attributes of permanent entities and subscripted system attributes<br />

places two or more attributes in each element of the same array. The declaration:<br />

permanent entities<br />

every HOUSE has an ( ADDRESS(1/2), and ZIP(2/2) )<br />

places similarly indexed values of ADDRESS and ZIP in the same location.<br />

This preamble declaration allows the executable statement create every HOUSE(5) to allocate<br />

storage as shown in figure 6-10.<br />

ADDRESS(1) ZIP(1) element 1<br />

ADDRESS(2) ZIP(2) element 2<br />

ADDRESS(3) ZIP(3) element 3<br />

ADDRESS(4) ZIP(4) element 4<br />

ADDRESS(5) ZIP(5) element 5<br />

Figure 6-10. Entity Storage<br />

More than one set of attributes, of course, may be packed in a single every statement; for example:<br />

every SHIP has a ( TONNAGE(1/2), CAPACITY(2/2) ),<br />

a ( DESTINATION(1/2), HOME.PORT(2/2) )<br />

This statement pairs the attributes TONNAGE and CAPACITY and the attributes DESTINATION and<br />

HOME.PORT within the elements of two attribute arrays. Some additional examples follow.<br />

normally mode is integer<br />

permanent entities<br />

264

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

Saved successfully!

Ooh no, something went wrong!