Progress
Programming
Handbook
Examples
These examples illustrate several features of persistent procedures. The application returns a customer name from the sports database when you enter a customer number. The main event-driven procedure,
p-persp1.p
, creates a persistent procedure fromp-persp2.p
and stores its handle in hdb-tools:
This persistent procedure provides two internal procedures to the application, get–cust–name and destroy–context. The get–cust–name procedure performs the database access for the application, and the destroy–context procedure deletes the context of the persistent procedure from the application.
Note that while
p-persp1.p
controls the application,p-persp2.p
provides all the code to manage itself, in this case to delete its own context. If you write an application with many persistent procedures, each one can provide a common set of internal procedures with the same name and interface, such as delete–context. Thus, the delete–context in one persistent procedure might operate differently than that in another, but they all can be called in the same context of the controlling procedure.In fact,
p-persp1.p
illustrates this generic procedure capability when you choose the bcancel button, by looping through the persistent procedure chain to delete thep-persp2.p
context. You can create any number of different persistent procedures with the PRIVATE–DATA attribute set to "DATABASE," and with many additional variations on the theme.NOTE: Persistent procedures that manage their own user interface often create and manage their own widget pools. For more information, see Windows."
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |