C
carl verbiest
Guest
I would expect the following loop to execute 5 times, going to the next iteration if an error occurs, but it stops after the first iteration.
What am I doing wrong ?
I can make it continue even if errors occur inside the loop by placing an extra do block inside the loop, but I'm curious why that is needed.
Continue reading...
What am I doing wrong ?
I can make it continue even if errors occur inside the loop by placing an extra do block inside the loop, but I'm curious why that is needed.
Code:
block-level on error undo, throw.
define variable cnt as integer no-undo.
loop:
do while true on error undo, next:
cnt = cnt + 1.
display cnt.
if cnt >= 5 then leave.
integer ("abc").
catch e as Progress.Lang.Error :
message "error in loop" cnt skip
e:getmessage(1) skip
view-as alert-box.
next loop.
end catch.
end.
Continue reading...