|
-
Apr 19th, 2009, 08:37 PM
#1
Thread Starter
Member
[RESOLVED] how do i preform reverse For loop ??
i'm sure its very simple, but i couldn't find how to do it
my normal use of For Loop
For x= 1 To 100
bla bla
Next
how do i "count down" like this
For X = 100 To 1
?
-
Apr 19th, 2009, 08:47 PM
#2
Re: how do i preform reverse For loop ??
-
Apr 19th, 2009, 09:13 PM
#3
Re: how do i preform reverse For loop ??
And if you don't know the exact code for it (step -1 would be the necessary addition) then just use basic arithmetic.
Code:
For x = 1 to 100
Dim y as Integer = 100 - x
Next
But yes it is worth using the code for, much shorter and easier.
-
Apr 19th, 2009, 09:30 PM
#4
Thread Starter
Member
Re: how do i preform reverse For loop ??
great, Step -1, silly me....
and yes i knew the arithmetic 100-x , but i got Loops within Loops and it started getting confusing, it was obviuse that should be the simplest way to "reverse" it.
thank you both,
resolved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|