Re: I miss loop
- From: "Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Mar 2006 15:00:42 -0800
"cj" <cj@xxxxxxxxxxxxx> wrote in message news:%23PqmYTHSGHA.4600@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for all the support. I posted this to Mythran also but I wanted to make sure you saw it as well.
In reviewing some of this just now I see one thing that would need to be considered in choosing goto vs nested loops. 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. I haven't tried but I get the impression from the help that goto can't be used to jump outside a loop (to the line above it) so it could be restarted, hence goto could only be used to go to the first line inside the loop. variables inside the loop would not be refreshed they would be as they existed before the goto was executed. This could be good or it could be bad. Just has to be checked into and considered.
Depends how you write it...
Your explanation is correct if written this way:
[begin loop]
[:MyLabel]
[do stuff]
[goto MyLabel]
[end loop]
You explanation is in-correct if written this way:
[begin loop]
[goto MyLabel]
[do stuff]
[:MyLabel]
[end loop]
So placing the label right before the loop re-starts will make it iterate/increment properly :)
Mythran
.
- Follow-Ups:
- Re: I miss loop
- From: cj
- Re: I miss loop
- References:
- I miss loop
- From: cj
- Re: I miss loop
- From: dotNuttah
- Re: I miss loop
- From: cj
- Re: I miss loop
- From: dotNuttah
- Re: I miss loop
- From: cj
- I miss loop
- Prev by Date: Re: How Many SQL Connections Should I Use?
- Next by Date: Re: Icons in Application Menus
- Previous by thread: Re: I miss loop
- Next by thread: Re: I miss loop
- Index(es):
Relevant Pages
|