Re: Iterate before loop end
From: Top Spin (ToppSpin_at_hotmail.com)
Date: 10/22/04
- Next message: Roman: "Method of the least squares"
- Previous message: Jezebel: "Re: Iterate before loop end"
- In reply to: Bob O`Bob: "Re: Iterate before loop end"
- Next in thread: Duane Bozarth: "Re: Iterate before loop end"
- Reply: Duane Bozarth: "Re: Iterate before loop end"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 00:03:33 -0700
On Thu, 21 Oct 2004 23:08:07 -0700, Bob O`Bob
<filterbob@yahoogroups.com> wrote:
>Top Spin wrote:
>
>> Here's my sample code. I would appreciate some help in what I can do
>> at line 13. I don't want to do the error testing at the top because it
>> changes and I am already doing it in the individual Case statements.
>
>
>Well, *I* would simply use a GoTo.
>
>But if you're unable to bring yourself to do such a thing, there are a few other
>choices, like moving the common processing to a separate procedure, or adding
>another "one-shot" block structure to permit coding an exit, such as in this
>example:
>
>
> Do
> For i = 1 to 1
> sAns = UserInput()
> Select Case UCase$(sAns)
> Case "abc"
> ...do some processing
> Case "def"
> ...do some processing
> Case "xyz"
> ...do some processing
> Case Else
> ...do some error processing
> Exit For
> End Select
> ...do some common processing
> Next
> Loop
Yep, that's pretty much what I came up with.
I did some coding in an IBM language called Rexx. It had several very
useful features such as the Iterate statement that would allow me to
restart any loop from anywhere inside that loop. For loops with
counters, I could also restart any of the outer loops as well. That
saved a lot of code in certain situations.
Thanks
-- Running MS VB 6.0 Pro (SP5) on Win2K-SR2 For email, use Usenet-20031220 at spamex.com
- Next message: Roman: "Method of the least squares"
- Previous message: Jezebel: "Re: Iterate before loop end"
- In reply to: Bob O`Bob: "Re: Iterate before loop end"
- Next in thread: Duane Bozarth: "Re: Iterate before loop end"
- Reply: Duane Bozarth: "Re: Iterate before loop end"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|