Progress
Version 9
Product Update Bulletin
Using Dynamic Invoke Only When Necessary
The "4GL Elements Related To Dynamic Invoke" section lists the 4GL elements that dynamic invoke involves. As you can see, the list is long.
Besides involving more 4GL elements, dynamic invoke requires more lines of code. Table J–3 shows the code required to invoke an external procedure dynamically and statically.
As Table J–3 illustrates, performing this task using dynamic invoke requires many more lines of code than does doing it with static invoke.
NOTE: For more information on this code, see the "Example 1 — Invoking an External Procedure Nonpersistently" section.For this reason, Progress Software Corporation recommends that you use dynamic invoke only when using static invoke is impossible.
Specifically, use dynamic invoke 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 dynamic invoke completely.- 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 dynamic invoke completely.- 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
orwidget:method
syntax — and avoid dynamic invoke completely.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |