next up previous
Next: FILE writes values in Up: INSTRUCTIONS Previous: DONODE prevents instruction execution

EXTR extracts a message from a list

Syntax:

    EXTR(<list name>, <pointer>) <associate instruction>;
It is used to extract a message from a list of messages.
<list name> indicates the list.
<pointer> is a variable declared of POINTER type or may be FIRST or LAST.
The pointed message (or the first or last) is extracted, the values of its fields are passed to the O_<variables> and the <associate instruction> is executed. After this, the values in the O_<variables> are passed to the fields of the messages. The <associate instruction> must have a SENDTO instruction to send the message to a list.

This instruction can be used in any type of node and in the associated instruction of a RELEASE.

Example:

  Process1 (R) Process2, ProcFile2 ::
            RELEASE BEGIN SENDTO(Process2);
            SCAN(IL_ProcFile1, PFile)
                      IF NumP1 = O_NumP1 THEN STOPSCAN;
            EXTR(IL_PartFile, PFile) SENDTO(ProcFile2)
            END;
            STAY := UNIF(32, 36);
When a message (object to be processed) leaves the node Process1 is sent to Process2. Then a IL (used to simulate a file) is scanned until a message is found with the same value in the field NumP1 as the leaving message. The found message, that is now pointed by the POINTER PFile, is extracted and sent to the node ProcFile2.



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