Kbase 13453: PERSISTENT RUN vs RUN for trigger code
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
PERSISTENT RUN vs RUN for trigger code
What is happening is that there are 2 different issues.
When doing a RUN, and not wanting the the trigger to
be fired use the construct of running a sub procedure,
using a DO END block with RETURN NO-APPLY.
When doing a PERSISTENT RUN, and wanting the trigger
to be fired, use the construct of running the subprocedure
with the RUN statement and RETURN ERROR in the subprocedure.
With specifying a PERSISTENT RUN, the trigger is scoped
to the procedure block, not the subprocedure block.
So even though the subprocedure has completed, the trigger
is still active. When specifying a RUN, the subprocedure
block ends and you loose the corresponding trigger code.
Here is a small example of the trigger code to
demonstrate the behavior:
RUN PERSISTENT RUN
---- --------------
TRIGGERS: TRIGGERS:
ON ANY-PRINTABLE ON ANY-PRINTABLE PERSISTENT
RUN trigsub.
DO:
RUN trigsub.
RETURN NO APPLY.
END.
END TRIGGERS. END TRIGGERS.
WAIT-FOR CHOOSE OF btn WAIT-FOR CHOOSE OF btn
IN FRAME frame-a. IN FRAME frame-a.
PROCEDURE trigsub. PROCEDURE trigsub.
Message "In trigsub." MESSAGE "In trigsub"
RETURN ERROR.
Using the above methods will give you the same results in both
cases.
Progress Software Technical Support Note # 13453