Progress
Language Tutorial
for Windows
Trigger Blocks
This is the basic and partial syntax for triggers.
The trigger header statement is the ON statement. You enclose the trigger block statements between DO and END as shown in the following code:
![]()
The trigger block properties are identical to the procedure block’s.
As you’ve seen, the trigger block allows the user to control an application by way of events.
You may, however, want to programmatically execute a trigger. In this case, you could use an APPLY statement. This is a partial syntax for the APPLY statement.
Here’s an example of using the APPLY statement:
Note that the event name in an APPLY statement is enclosed in quotation marks, which is not the case for the ON statement.
In general, you should avoid using APPLY because too many APPLY statements make your code hard to follow and also because APPLY is not a very efficient way to execute triggers. If you have code in a trigger and want to execute the same code from another location, move the trigger code into an internal or external procedure. Then, you can access the code with a RUN statement from inside a trigger or anywhere else.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |