[Progress Communities] [Progress OpenEdge ABL] Forum Post: How to retry from within catch block

Status
Not open for further replies.
C

cverbiest

Guest
I'm trying to retry from within a catch block The manual OpenEdge 11.7 Documentation states The code in any CATCH block can contain an explicit flow-of-control directive , meaning LEAVE, NEXT, RETRY , RETURN, or THROW. (RETRY and THROW require UNDO.) Since CATCH is an undoable block, LEAVE, NEXT, and RETRY without a label will apply to the CATCH block itself and not the associated block. If you want LEAVE, NEXT, or RETRY to apply to the associated block of a CATCH block, you must use the existing label syntax for these statements. An explicit UNDO, THROW in a CATCH block causes the AVM to raise ERROR or STOP in the block that encloses the associated block of the CATCH block; not the associated block itself. However if I run my sample code I get a compilation error. Seems like a bug to me, or am I missing something ? --------------------------- Syntax check: Cannot UNDO to block 'tryblock' from within a CATCH block for block 'tryblock'. (14134) --------------------------- define variable lInt as integer no-undo. define variable lText as character no-undo init "abc123". tryblock: do on error undo, retry: lint = integer(lText). catch err as Progress.Lang.Error : if lText > "" then do: substring(lText, 1, 1) = "". undo tryblock, retry tryblock. end. end catch. end.

Continue reading...
 
Status
Not open for further replies.
Top