Consultor Eletrônico



Kbase P169246: STOP condition isn't propagated back to the calling block
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   06/07/2010
Status: Unverified

SYMPTOM(s):

STOP condition isn't propagated back to the calling block

The STOP condition is propagated back to the calling program only if a FINALLY block exists in the called method.


For example, the following code reproduces the problem. But remove the comments around the FINALLY block and the issue no longer occurs.

/* teststart.p */
DEFINE VARIABLE myTest AS CLASS teststop.
myTest = NEW teststop().
DO ON STOP UNDO, LEAVE:
myTest:test1().
MESSAGE PROGRAM-NAME(1) "3 - You see this message when test1() catches the stop" VIEW-AS ALERT-BOX.
END.
MESSAGE PROGRAM-NAME(1) "4 - You see this message when the test ends." VIEW-AS ALERT-BOX.

/* teststop.cls */
USING Progress.Lang.*.
CLASS teststop:
METHOD PUBLIC LOGICAL test1():
DEFINE VARIABLE myResult AS LOGICAL NO-UNDO.
DO ON STOP UNDO, LEAVE:
myResult = test2().
MESSAGE PROGRAM-NAME(1) "1 - You dont not see this message after a stop" VIEW-AS ALERT-BOX.
END.
MESSAGE PROGRAM-NAME(1) "2 - After on stop undo" myResult VIEW-AS ALERT-BOX.
/* Activate this code to fix the problem. */
/* FINALLY: */
/* END FINALLY. */
END METHOD.
METHOD PUBLIC LOGICAL test2():
STOP.
RETURN TRUE.
END METHOD.
END CLASS.

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1x
OpenEdge 10.2x

CAUSE:

Bug# OE00194337

FIX:

Upgrade to OpenEdge 10.2B01 or later.