Re: Using Wildcards in a Select Case Statement ?
From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 07/15/04
- Next message: Duane Bozarth: "Re: Using Wildcards in a Select Case Statement ?"
- Previous message: Bob O`Bob: "Re: Dim as new question?"
- In reply to: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Next in thread: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Reply: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Messages sorted by: [ date ] [ thread ]
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 :
- Next message: Duane Bozarth: "Re: Using Wildcards in a Select Case Statement ?"
- Previous message: Bob O`Bob: "Re: Dim as new question?"
- In reply to: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Next in thread: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Reply: J French: "Re: Using Wildcards in a Select Case Statement ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|