1. Re: More Wish List

Sorry david,
I didn't make it too clear I suppose.

How about ...

    for i = 1 to length( s ) do
       ... code goes here ...
       if test1 then
          exit code1
       end if
       ... more code can go here ...
       if test2 then
          exit code2
       end if
       ... more code can go here ...
       if test3 then
          exit code1
       end if
       ... more code can go here ...
    when code1
       exception processing ...
    when code2
       exception processing ...
    end for


----- Original Message -----
From: "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, September 30, 2000 8:10 AM
Subject: Re: More Wish List


> Derek Parnell wrote:
>
> >    for i = 1 to length( s ) do
> >       ... code goes here ...
> >       if test1 then
> >          exit code1
> >       end if
> >       ... more code can go here ...
> >       if test2 then
> >          exit code2
> >       end if
> >       ... more code can go here ...
> >    when code1
> >       exception processing ...
> >    when code2
> >       exception processing ...
> >    end for
>
> I'm not entirely clear what's happening here. If the intent is to allow
the
> user to jump to the bottom of the loop, run the exception processing, and
> exit, this will accomplish the same thing, with no new construct and the
> same amount of code.
>
>    for i = 1 to length( s ) do
>       ... code goes here ...
>       if test1 then
>          code1 exception processing
>          exit
>       end if
>       ... more code can go here ...
>       if test2 then
>          code2 exception processing
>       end if
>       ... more code can go here ...
>    end for
>
> Am I missing something?
>
> -- David Cuny

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu