Consultor Eletrônico



Kbase P51600: Dynamic programming versus Static programming
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/3/2003
Status: Unverified

GOAL:

Dynamic programming versus Static programming

GOAL:

Can we use a Static FOR EACH against a Dynamic Temp-table?

GOAL:

Can we use a Dynamic method against a static buffer?

GOAL:

Can we use a Dynamic method against a static temp-table?

FIX:

With a static buffer (for both temp-tables or database tables), you can use both Static Statements and Dynamic Statements, such as CREATE or BUFFER-CREATE(). On the other hand, with Dynamic Buffers (again for both temp-tables or database tables), you can only use dynamic programming (only BUFFER-CREATE())


With more details:
0) Dynamic object = object created at runtime
Static Object = object defined at compile time (in .R, or compilation
on the fly)

1) A 'temp-table' can be either static or dynamic
=> Defined in .R, or created at runtime.
=> It has a handle

2) A database table is NEITHER static NOR Dynamic (defined in the database)
=> It has NO handle, we play only with its buffers (such as the DEFAULT-BUFFER). Note that hBuffer:TABLE-HANDLE is unknown if the buffer is not associated with a temp-table, as documented

3) Buffers can be either static (in .R) or dynamic (created at runtime).

4) With a static buffer, you can use both Static Statements/Functions (FIND, AVAILABLE) or Dynamic programming (play with handle:method/attribute)

5) A Dynamic buffer object does not exist at compile time (such as in a .R), and is created only at compile time, so it cannot be handled by a Static Statement (such as FOR). Therefore you can use only dynamic programming with Dynamic buffers.