The block structured DO does not generate a DO frame on the
frame stack which is why the behavior is different.

One possibility would be to move the Error3 tag so its up after
the While.

Do {
  Set $zt="Error3"
  For i=1:1:10 {
  w !,i
  if i=5 set a=XyZ ;forced UNDEF Error!!!
  }
} While 1

Error3 ;
 s $zt=""
 w !,"go on Test3"
 Quit

Another possibility is to add a local variable which contans the
tag you want to goto after an error and then use "go:$L(errtag) @errtag"
instead
of quit in the error handler. You'd want to be pretty religious about
clearing
errtag so that the program isn't too hard to follow.

It might also be possible to use $ETRAP to dismiss the error and then test
$ECODE as part of the condition for exiting the loop or have $ETRAP set
an error variable that you test in the while.

"Bernd Mueller" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
> how can i get the same behavior as Test4 in "modern-cos" ? (without
dot-syntax)
> On error i want to go on with the code.
> Test3 unfortunately does not work ... the Quit in the Error-Handler
> quits whole Test3 :-(
>
> Any ideas ?
>
> Thanks and Regards...
> Bernd!
> ------
>
> Test4 ;Call by Do
>
> Do
> . Set $zt="Error3" For i=1:1:10 w !,i if i=5 set a=XyZ ;forceded UNDEF
Error!!!
>
> w !,"go on Test4"
>
> Quit
>
> Test3 ;Call by Do
>
> Do {
>   Set $zt="Error3"
>   For i=1:1:10 {
>   w !,i
>   if i=5 set a=XyZ ;forced UNDEF Error!!!
>   }
> } While 1
>
> w !,"go on Test3"
>
> Quit
>
> Error3 ;
> set $zt=""
> Quit



Reply via email to