STOPSCAN;It is used to stop the scanning of a list (EL or IL). When used in a SCAN instruction the list is that indicated in the instruction. If it is used in a type G node outside a GLIDER instruction the list is the EL of the node.
This procedure can be used in nodes of G type, and within a SCAN instruction, in any type of node permitting SCAN.
Example:
Test STOPSCAN Example 1 NETWORK Tour_Gate (G) Ballon_Gate :: TotWeight := TotWeight + Weight; IF (TotWeight <= 930) AND NOT Complete THEN BEGIN SENDTO(Balloon_Gate); END ELSE BEGIN STOPSCAN; Complete := TRUE; TotWeight := 0; END; Balloon_Gate (G) :: IF Complete and Present THEN BEGIN SENDTO(Tour); IF LL(EL_Ballon_Gate) = 0 THEN BEGIN NBatch := NBatch + 1; Complete := FALSE; Present := FALSE; TotWeight := 0; END; END; Tour (R) :: RELEASE Present := TRUE; STAY := UNIF(50, 63); Exit (E) :: INIT ACT(Entrance, 0); NBatch := 0; TotWeight := 0; Present := TRUE; Complete := FALSE; Tour := MAXREAL; DECL VAR NBatch: INTEGER; TotWeight: REAL; Present, Complete: BOOLEAN; MESSAGES Entrance(Weight: REAL); STATISTICS ALLNODES;Messages (passengers for a balloon) are weighted at Tour_Gate. While the total weight is less than 930 and Complete was FALSE they are sent to Balloon_Gate. When one incoming message cause the weight to exceed 930, the scanning of the EL is stopped, Complete is put to TRUE and TotWeight to zero. No more passengers can pass the Tour_Gate. Then Balloon_Gate can operate if the balloon is present (Present = TRUE). The messages in the EL are sent to Tour. Complete and Present are put to FALSE and the batch is counted. TotWeight is set to zero to permit the gathering of a new batch of passengers. The Tour takes between 50 and 63 minutes. When it finishes the passengers went to Outside and Present becomes TRUE.