Re: Using Wildcards in a Select Case Statement ?

From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 07/15/04


Date: Thu, 15 Jul 2004 14:54:02 -0400

But if you used:

Do while 1 = 1

  For L9 = 1 To Max
      If Something Then
         If SomeCheck Then
            If AnotherTest Then
               DoSomething
               Exit Do
            End If
         End If
     End If

loop

... you could, as above, use Exit Do.

-- 
Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"J French" <erewhon@nowhere.com> wrote in message 
news:40f53b4f.18647043@news.btclick.com...
: On Tue, 13 Jul 2004 11:38:42 -0700, Bob O`Bob
: <filterbob@yahoogroups.com> wrote:
:
: <snip>
:
: >
: >
: >Outside of error trapping, I have never *and I mean NEVER* needed a GoTo 
in VB.
: >I'm not strongly opposed to them, I just haven't been shown a case where 
I can't
: >find a more 'structured' alternative.
: >
: >I'm even almost fond of  "Do ... Loop While False" blocks, which I use 
just so that
: >I can put "Exit Do" inside.  And other such structures.  I can recall 
needing to
: >nest some of those, and have at least once used "For i = 1 to 1 ... Next" 
so that
: >the "Exit For" could be distinct from the "Exit Do"
:
: Oddly I avoid On Error Goto
: - and prefer On Error Resume Next
:
: I have found a fair number of cases where a GoTo simplifies the code
: - normally I try to avoid it, but sometimes the alternative constructs
: that one produces are so convoluted that I have to revert to the
: original structure
:
: Normally it happens in large For Next Loops when processing records
:
: For L9 = 1 To Max
:       If Something Then
:          If SomeCheck Then
:             If AnotherTest Then
:                DoSomething
:                Goto DONE
:             End If
:          End If
:      End If
:
:      ......
: DONE:
: Next
:
: Essentially a substitute for 'Break' in Pascal, and I suspect there is
: something similar in 'C'
:
: Personally I dislike seeing GoTo's
: - but if they simplify the code I'll use them
: 


Relevant Pages

  • Re: how do people feel about exit function from loop
    ... stand out to me far better than a For Next loop for that, ... line, the line that starts the loop, I know ALL the exit conditions for the ... And now we get back to why Goto is "silly" when Exit is not. ... as I have knowledge of only a few languages. ...
    (microsoft.public.vb.general.discussion)
  • Re: I miss loop
    ... I refered to exit sub where I meant exit do. ... I'm not sure but I suspect the functionality of the not in VB.net 2003 loop/continue statement would work more like the nested loops alternative than the goto alternative. ... In a nested loop situation the exit sub would exit the inner loop and therefore you'd re-enter the loop with any variables declared inside the loop being refreshed, for lack of a better word. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: "continue/next" for "loop"
    ... Ada 200X. ... goto exit; -- exit innermost enclosing loop. ...
    (comp.lang.ada)
  • Re: FORTRAN "Source Code to Flow Chart Converter" Available
    ... >> can EXIT a loop, possibly using a labelled DO loop when loops are ... so one need not GOTO the last line of a procedure ... >> to exit it. ... > the type of person who, if a STAT or IOSTAT specifier exists, I check it. ...
    (comp.lang.fortran)
  • Re: Infinite Loops and Explicit Exits
    ... > CS> One of these proposals relaxes the current restriction that an EXIT ... > termination of the loop is not visible at that point. ... > terminating condition is visible in that context. ... > You now want to allow this remote procedure, ...
    (comp.lang.cobol)