Consultor Eletrônico



Kbase P131280: Running a top procedure which call another procedure with run-time compilation lead to error 196 wit
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/8/2008
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.x
All Supported Operating Systems
OpenEdge Category: Language (4GL/ABL)

SYMPTOM(s):

Running a top procedure which call another procedure with run-time compilation lead to error 196 with an infinite loop when the callee procedure reference a Database Field and no Database is connected to the session.

** <program> Could not understand line <number>. (196)

CAUSE:

This is expected behavior because Progress will not raise an ERROR condition and the top procedure will retry to run.
To illustrate the problem.
/* Caller.p*/
RUN Callee.p.
/* Callee.p */
DEFINE VARIABLE MyVar LIKE Cust.name.
from Proenv do:
mpro -p Caller.p
If a -p name.p is given to start up with, the 4GL/ABL Engine assume that it could be that it is an application that wants to "trap" the user within an environment.
If that top .p gets a STOP condition (which a missing procedure or db produces) we re-execute that same top .p.
The reason for that is that we are assuming that the user hit CTRL-C to escape the environment of the top .p and the 4GL/ABL Engine want to defeat that.

FIX:

The solution is to trap STOP condition. But then this will disable the behavior that hitting the CTRL-C is ignored at that level in the application. Instead, it will be QUITed out of the session.
The Caller procedure (or top procedure) should be like this.
/* Caller.p */
PAUSE 0 BEFORE-HIDE.
DO ON STOP UNDO, LEAVE:
RUN Callee.p
END.
QUIT.