Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
SpeedScript : Elements of SpeedScript syntax : Running procedures and Web objects : Persistent procedures
 
Persistent procedures
Among the most important forms of the RUN statement is the RUN statement using the PERSISTENT option. When you execute an external procedure, the PERSISTENT option causes the procedure context, including all of its data and internal procedure definitions to remain active in memory after the main-line of the procedure has returned to the caller.
This feature allows you to create (instantiate) SpeedScript objects, of which Web objects are the most important in WebSpeed. This is possible because when you RUN a procedure persistently, you can obtain a handle to the procedure's active context. This procedure handle allows you to execute any internal procedure defined inside the persistent procedure context. You do this using the IN option of the RUN statement, where you run an internal procedure in the handle of the persistent procedure. Thus, the persistent procedure maintains state for all of its internal procedure executions.
This is also how method and event procedures are implemented in WebSpeed. Generally, you run method procedures in the handle web-utilities-hdl (for the common utility method procedures in web-util.p) or the handle THIS-PROCEDURE (which references the current external procedure or Web object).