Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For loop clarification , need help

Status
Not open for further replies.

shankark

Technical User
Apr 2, 2002
8
0
0
MY
Hai all,

for i=0 to 5
beep
next i

for i=0 to 5
beep
next

watz the diff. between these 2 coding.. what is the use of "next i".. clarify me.. with example / situations please.. Advance thanks for the help.

regds, shankar k. Warm Regds,
Shankar K.
 
The functionallity of the two is the same. I have heard that the use of just next (not next i) is slightly faster, I have yet to confirm that but I do not use any large loops. If I had to guess why someone would use "next i" I would say that they were using a nested loop and wanted to make their code more readable but proper indentation works just as well. Anything is possible, the problem is I only have one lifetime.
[cheers]
 
There isn't a difference. I just use the "Next i" to keep it clean. As foada suggested for nested loops. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top