next up previous
Next: DOEVENT permits instruction execution Up: INSTRUCTIONS Previous: DBUPDATE updates a DBASE

DISASSEMBLE disassembles assembled messages

Syntax:

    DISASSEMBLE <associated instruction>;
This instruction is used to extract messages from an assemble list generated by an ASSEMBLE instruction.
When it is processed, it is supposed that a message is being processed. Then it is checked if the message has a pointer to an assemble list. If there is not that list, nothing is done. If there is a pointer to a list, the list is scanned from the beginning to the end and, for each message, the <associated instruction> is executed. The fields of the message are in the O_<fields>. If the <associated instruction> executes a SENDTO, the O_<fields> are passed to the message which is extracted from the assemble list and it is sent to the indicated node. If no sending is occured, the O_<fields>, that may have been changed, are passed to the message and this remains in the assemble list. The representant message (see instruction ASSEMBLE, 6.1) may be disposed before or after the execution of the DISASSEMBLE instruction.

DISASSEMBLE may be used in nodes of G, D, E ,and of general type and in the RELEASE instruction of an R node.

Examples:

  1.     Travel (R) :: RELEASE
                            DISASSEMBLE SENDTO(Depot[Typ]); SENDTO(Parking);
                            STAY := Travel_Time(Weather);
    After remaining in the IL of the node Travel for a time that is a function of the variable Weather, the representants are released and their assembled lists are disassembled. Messages of the assembled list (transported items) are sent to the different nodes Depot according the value of the field Typ; the representant (transporter) is sent to the node Parking.
  2.     Bus_Stop Exit_Pas (E) ::
                       DISASSEMBLE
                        BEGIN By_Bus := TRUE; N_Arr := N + 1;
                         IF By_Air THEN SENDTO(Airport)
                                   ELSE SENDTO(RailRoad)
                        END;
    Messages (passengers) of the assembled list of the first message (bus) are marked in the field By_Air to TRUE and a number of arrival is put to each (N was initialized to 0). Those with the field By_Air are sent to the node Airport, the others are sent to Railroad. As the node is of E type, the original message is destroyed (See example 13, GLIDER examples book).

next up previous
Next: DOEVENT permits instruction execution Up: INSTRUCTIONS Previous: DBUPDATE updates a DBASE

domingo c
Mon Mar 20 17:36:19 PST 2000