Progress
ADM 2 Guide


RUN Statement

Many aspects of SmartObject behavior are invoked by running internal procedures and invoking functions. Much of this behavior is implemented in super procedures that support the SmartObjects. The behavior in super procedures can be localized and the Progress interpreter will locate and execute the correct behavior. This is possible because super procedures are initialized and added to each SmartObject as each SmartObject starts up.

For example, an application can use the addLink procedure to add a link from one SmartObject to another during execution:

RUN addLink ( hSourceProc, ’navigation’, hTargetProc ). 

In this code, hSourceProc is the HANDLE of the source procedure and hTargetProc is the HANDLE of the target procedure.

The RUN statement for addLink is written as if addLink were an internal procedure within the calling procedure. In fact, it is contained in the super procedure smart.p. The super procedure mechanism makes the contents of smart.p available to every SmartObject. Standard behavior of this kind includes the following procedures (any many others):

Similarly, the contents of other SmartObject super procedures are available to SmartObjects that require their support. For example, all visible objects use the super procedure visual.p and all SmartObjects that can contain other SmartObjects use containr.p. (See the AppBuilder online help for a detailed list of super procedures and their contents.) Using this architecture locates the majority of SmartObject behavior in a set of independently built procedures that can serve all SmartObjects that are running in a Progress session. This helps to organize behavior into reusable classes and keeps the size of individual SmartObjects to a minimum.

Just as a SmartObject can RUN procedures that are implemented in its super procedures, a SmartObject can invoke behavior in another SmartObject simply by knowing its procedure handle and running internal procedures or functions in that SmartObject. For example, one SmartObject can destroy another by executing the following statement:

RUN destroyObject IN hOtherObject. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095