Bob,
Good structuring your program is not only avoiding the Goto however as well
some other commands where it was by instance in Cobol the Alter which was
one of the options to continue on a different place again.
A lot of us think they should be banned from program languages.
Programmers who made non structured programs will always exist and therefore
these awfull commands are comming back in new languages where they first
where banned because those programmers are screaming for them because they
had them in past.
I would go for the code from Ken.
And when you cannot, look first for another classic awfull command, however
what is implemented in VBNet very good for structuring your program; the
Select. Case
Just my thought,
Cor
"eBob.com" <eB******@totallyfakeisp.com>
Thanks Ken. Yes. I meant to say in my post that I knew I could avoid
the GoTo by restructuring the If. And I suppose that even works in
general. BUT ... I am still wondering if there is some language
construct specifically for this. I also meant to say that I was
looking for the equivalent of the C/C++ continue statement.
But you would have mentioned the VB equivalent of the the C/C++
continue statement in your response, so I am gathering that VB does
not have such a construct. I guess I can live without it.
Thanks again, Bob
On Sun, 10 Oct 2004 19:11:54 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,
What is wrong with this.
For Each Thing As OFI In FileInfo
If Thing.Displayed = True Then
If yada yada yada Then
TextBox2.Text = Thing.Name
End If
End If
Next Thing
Ken
-----------------------
"eBob.com" <eB******@totallyfakeisp.com> wrote in message
news:lk********************************@4ax.com. ..
How do you make a loop iterate early without using a GoTo? (I guess
I've done too much structured programming and I really don't like
using GoTos.)
Here's my code ...
For Each Thing As OFI In FileInfo
If Thing.Displayed <> True Then
GoTo Iterate 'skip this entry; try next one
End If
If yada yada yada Then
TextBox2.Text = Thing.Name
End If
Iterate:
Next Thing
I'm thinking that there has to be some way to do this without using
GoTo but I've not been able to find it.
Thanks, Bob