Kbase P58392: When should I use Dynamic Invoke
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
When should I use Dynamic Invoke
FIX:
Version 9.1D supports dynamic invoke, which lets you invoke logic dynamically.
Specifically, use dynamic invoke in the following situations:
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 procedure is unknown at compile time, use the RUN statement with the VALUE option and avoid dynamic invoke completely.
To invoke a function whose calling sequence 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 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 dynamic invoke completely.
Progress Software Corporation recommends that you use dynamic invoke only when using static invoke is impossible since dynamic invoke requires many more lines of code than does doing it with static invoke.