Results 1 to 5 of 5

Thread: simple question...

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Smile

    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

  2. #2
    Addicted Member
    Join Date
    Nov 2000
    Posts
    143
    Nothing at all.
    It is a matter of preference. Some think that ending the loop w. next then the variable is easier to read.

  3. #3
    New Member
    Join Date
    Nov 2000
    Posts
    14

    no diff

    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.

  4. #4
    Member
    Join Date
    Nov 2000
    Location
    Vienna, Austria
    Posts
    62
    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 :-)
    Life is trip, eat it and smile.

  5. #5

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up Thanks

    Thanks all guys!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width