Make your own free website on
4.2.4 How to Trigger a Condition Trap
What are the situations where a condition trap might be triggered?
It depends on the method currently set in the condition trap.

If the method is SIGNAL, then the interpreter will explicitly
trigger the relevant trap when it has raised the condition after
having sensed the incident. Note that only the particular trap in
question will be triggered in this case; other traps will not be
triggered, even if the pending event queue is non-empty.

In addition, the interpreter will at each clause boundary check
for any pending events in the event queue. If the queue is non-
empty, the interpreter will not immediately execute the next
normal statement, but it will handle the condition(s) first. This
procedure is repeated until there are no more events queued. Only
then will the interpreter advance to execute the next normal

Note that the REXX standard does not require the pending events to
be handled in any particular order, although the model shown in
this documentation it will be in the order in which the conditions
were raised.  Consequently, if one clause generates several events
that raise conditions before or at the next clause boundary, and
these conditions are trapped by method CALL. Then, the order on
which the various traps are triggered is implementations-
dependent.  But the order in which the different instances of the
same condition is handled, is the same as the order of the
condition indicator queue.