Results 1 to 3 of 3

Thread: Easy - for loop

  1. #1
    james007lamb
    Guest

    Question Easy - for loop

    i understand that if you want to use a for loop and want to increment in steps of 1 you use the following

    For i = 1 To 5
    ...
    Next i

    However how do i program it if i wish to increment nackwards in steps of -1, say from i =5, to i =1 in steps of -1

    Please help!!!

  2. #2
    hellswraith
    Guest
    VB Code:
    1. For i=10 To 0 Step -1

  3. #3
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    VB Code:
    1. For i = 5 To 1 Step -1  'Will count backwards
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

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