Consultor Eletrônico



Kbase P120292: Functions that return VOID do not compile.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/8/2010
Status: Verified

SYMPTOM(s):

Functions that return VOID do not compile.

VOID functions that compiled previously no longer compile, generating error 5622

UPDATE, SET, PROMPT-FOR, CHOOSE, INSERT, WAIT-FOR, and READKEY statements are not permitted inside a user-defined function. (5622)

** Could not understand line. (196)"

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1x
OpenEdge 10.2x

CHANGE:

Upgraded from OpenEdge 10.1A01 to OpenEdge 10.1A02

CAUSE:

It is illegal to use input blocking statements (UPDATE, SET, etc.) in a user defined function. However, the introduction of a VOID return type for functions made it possible (incorrectly) to use input blocking statements in a function that returns VOID, by calling a VOID method that (correctly) used input blocking statements. To prevent this problem, beginning in OpenEdge service pack 10.1A02 VOID functions are not allowed. Compiling such code now generates error 5622.
If a user defined function calls a VOID method in a class which is compiled on the fly, and that class contains an input blocking statement, it will generate compile error 5622 when the function is run and the class is compiled. If the user defined function calls the same method in a precompiled class, error 2780 (Input blocking statement is invalid while executing a user-defined function or method) will be generated at run time.
VOID methods containing input-blocking functions will compile and run correctly if they are not called from within user defined functions.

FIX:

This is expected behavior. Functions returning VOID are not allowed in OpenEdge 10.1A02 and later.