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