Call for help on enhancing one kb

Posted by OctavioOlguin on 15-Mar-2016 16:15

Greetings.

I found this kb extremelly intersting and foundation to a solid understanding on the OpenEdge develoment.

The problem is when finished reading it, I endend more confused that at first time.  Perhaps someone could develop 15 lines ont the subject, or a simple example, to remove the cripticness of the kb.  And perhaps good'ol Jean would then enhance the kb.  At the end, with all this movement of promoting opendge to new users, the entire openedge ecosphere will be enriched.

this is it

http://knowledgebase.progress.com/articles/Article/How-to-trap-a-Stop-condition-sent-by-Ctrl-Break-or-clicking-cancel-on-a-Wait-or-click-cancel-to-stop-progress-message?popup=true

Thanks

All Replies

Posted by Lieven De Foor on 16-Mar-2016 11:03

This KB article just tells you you can't write a global STOP handler in the block that runs the Application:Run().

You should write the ON STOP blocks on a lower level for them to work as expected.

Posted by OctavioOlguin on 17-Mar-2016 14:00

Is there somehow that anybody could write a template as an example?

/*begin main procedure */

BLOCK-LEVEL ON ERROR UNDO, THROW.

run PotentiallyStoppedProc.

CATCH e1  AS Progress.Lang.Error :

MESSAGE "Stop catched!" VIEW-AS ALERT-BOX.

END CATCH.

/*  end main procedure*/

PROCEDURE PontentiallySoppedProc:

run proc\nonexistent.p.

END PROCEDURE

/*---------------------------*/

The main question that arise here are:

the catch e1, should build upon which kind of object?  App, Sys, or Error.

the PontentiallySoppedProc procedure, should have a catch itself, for the process of stop, besides the fact that perhaps it will have one for the nature of it's operations.  In this catch sould RETURN NEW ERROR "....."  ?

This thread is closed