What the different between
Code:For i = 0 to 100
'Blah Blah blah......
Next
Code:For i = 0 to 100
'Blah Blah Blah......
Next i
Printable View
What the different between
Code:For i = 0 to 100
'Blah Blah blah......
Next
Code:For i = 0 to 100
'Blah Blah Blah......
Next i
Nothing at all.
It is a matter of preference. Some think that ending the loop w. next then the variable is easier to read.
:)
there's no difference at all, if you say "Next" then VB will assume the previous For loop. If you say "Next i" VB will just continue with whichever For..Next statement that meets the criteria.
It makes the code more clear for others to read as well as for your self. If you have many for-next cases, expecially when you jump between procedures, you can get confused easily.
With VB it's still not confusing even if you have 20 for-next cases, but take a look at the good old GW-Basic, where there was not even a debugger...God, that was confusing :-)
Thanks all guys!