Progress
Programming
Handbook
Creating Persistent Procedures
To make an external procedure persistent, execute it using the PERSISTENT option of the RUN statement. This is an instantiating RUN statement, because it both executes the external procedure and creates a persistent instance of its context:
The filename and run-options are the same as for any external procedure (see the "External Procedures" section).
The handle is a field or variable defined with the HANDLE data type. The RUN statement sets handle to a procedure handle value that identifies the current context of the persistent procedure. You can use this procedure handle to invoke procedure triggers or internal procedures defined in the persistent procedure context. For information on procedure handles, see the "External Procedures" section.
For example, this code fragment creates two persistent procedures from
db-tools.p
anddde-tools.p
, and assigns the procedure handles to hdb–tools and hdde–tools, respectively:
Assume that these two procedures interact with the sports database (
db-tools.p
) and a spreadsheet application using Windows Dynamic Data Exchange (DDE) (dde-tools.p
). The fragment then runs the internal procedures within these persistent procedures to add customer information to a spreadsheet named Customer Activity. (For more information on using DDE, see the Progress External Program Interfaces manual.)This application fragment shows how you can use persistent procedures to set up modular environments that encapsulate processing details from the rest of an application.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |