Kbase P7924: What causes error 2780?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/13/2009 |
|
Status: Verified
GOAL:
What causes error 2780?
GOAL:
Explanation of error 2780 (Input blocking statement is invalid while executing a user-defined function)
FACT(s) (Environment):
All Supported Operating Systems
Progress/OpenEdge Product Family
FIX:
In order for PROGRESS to allow input blocking, control must be given to the Windows code that handles and dispatches events (that is, the part that actually "runs" the code.) PROGRESS is unable to call this code proactively: rather, it is the Windows code that makes calls to PROGRESS and essentially makes the program functionality happen. The only way that PROGRESS can give control back to the windowing system is for it to return to it passively.
While an expression is being evaluated by PROGRESS it is not possible to return control to the windowing environment in this manner -- PROGRESS is required to remain in an execution context that temporarily prevents it from doing so.
Since the windowing system must do any input blocking, this means that during the evaluation of an expression it is not possible to get back to the windowing system in order for input blocking to occur.
This is where user defined functions enter the picture, since they are part of expression evaluation. For this reason the compiler will not allow the placement of an input blocking statement directly inside a user-defined function.
How does one prevent this error from arising at runtime? The old-fashioned way: testing and taking out the input blocking statements.
User-defined functions cannot tolerate input blocking. Input blocking statements include PROMPT-FOR, SET, UPDATE, WAIT-FOR, READKEY and PROCESS EVENTS.