Progress
Version 9
Product Update Bulletin
CALL Object Handle
A handle to a CALL object, which lets you do the following dynamically:
Invoking logic dynamically requires many more lines of code than does invoking it statically, which can make your program hard to read. For this reason, Progress Software Corporation recommends that you invoke logic dynamically only when absolutely necessary. Specifically, use the CALL object only when you cannot use the RUN statement, the DYNAMIC-FUNCTION() function, or widget:attribute or widget:method syntax, as in the following situations:
NOTE: But if only the name of the procedure is unknown at compile time, use the RUN statement with the VALUE option — and avoid the CALL object all together.- To invoke an internal or external procedure whose calling sequence (number of parameters and the data type of each) is unknown at compile time
NOTE: But if only the name of the function is unknown at compile time, use the DYNAMIC-FUNCTION() function — and avoid the CALL object altogether.- To invoke a function whose calling sequence is unknown at compile time
- To reference a widget attribute or method whose name is unknown at compile time
If you already know the name of the attribute or procedure, you know its syntax, since the name implies certain syntax. And if you know the syntax, you know the calling sequence, since the syntax defines the calling sequence. And if you know the calling sequence, you can use widget:attribute or widget:method syntax — and avoid the CALL object altogether.
The CALL object handle has attributes and methods that tell CALL what to do, how to do it, and when to do it.
SYNTAX
call-object-handle
A handle to a CALL object.
attribute
An attribute of the CALL object. Table D–1 summarizes each attribute.
method
A method of the CALL object. The methods let you set parameters, reset attributes to their default values, and invoke the CALL object.
Table D–2 briefly describes each method.
EXAMPLES
The following fragment dynamically invokes an external procedure nonpersistently:
:
The following fragment dynamically invokes an external procedure persistently, then dynamically invokes one of its internal procedures:
The following fragment uses a single CALL object handle multiple times:
The following fragment gets an attribute:
The following fragment sets an attribute:
The following fragment drives the INVOKE() from a TEMP-TABLE:
NOTES
- To create a CALL object, use the following syntax:
For example:
NOTE: Unlike most 4GL objects, the CALL object, by default, goes into the SESSION widget pool, not into the closest unnamed widget pool.
- To delete a CALL object, use the following syntax:
For example:
Since the CALL object, by default, goes into the SESSION widget pool, not into the closest unnamed widget pool, to delete a CALL object created when the IN widget-pool option is not used, use the DELETE object handle syntax explicitly,
- Invoking logic dynamically requires more lines of code than does invoking logic statically and can make your program hard to read. For this reason, Progress Software Corporation recommends that you invoke logic dynamically only when invoking it statically is impossible.
SEE ALSO
RUN Statement in the Progress Language Reference .
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |