Progress
Programming
Handbook
Reverting Triggers
To cancel a trigger definition before it goes out of scope, use the REVERT option of the ON statement. The REVERT option cancels any trigger for the event-widget pair defined in the current procedure or trigger.
In the following procedure,
p-rev.p
, two triggers are defined for the selection of hello–button: one in the outer procedure and one in the internal procedure, inner. At the first WAIT–FOR statement within inner, the local trigger is active. Therefore, when the user selects the button, “Inner message” is displayed. Before the second WAIT–FOR, this trigger is reverted. The trigger from the outer procedure becomes active again. Therefore, when the user selects the button again, “Outer message” is displayed.
NOTE: You cannot use REVERT to cancel a persistent trigger. Instead, you must set up a replacement persistent trigger where the procedure consists only of a RETURN statement.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |