Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Reverse For Loop Syntax

Reply
Thread Tools

Reverse For Loop Syntax

 
 
Adrienne Boswell
Guest
Posts: n/a
 
      08-09-2006
Today, I am braindead... I can't seem to find this in Google, and I
don't remember where I used this code before (so I can't steal it from
myself). Anyway, all I want to do is:

for i = 0 to 20 step -1
response.write "<br>" & i
next

For some reason, that doesn't work. It shows nothing. I know I am
missing something very simple, but, as I said, today, I am braindead.

--
Adrienne Boswell at work
Administrator nextBlock.com
http://atlas.nextblock.com/files/
Please respond to the group so others can share

 
Reply With Quote
 
 
 
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      08-09-2006
Uh, did you mean for i = 20 to 0 step -1?

If you're going -1 each step, and you start at 0, you're not going to get
too far.





"Adrienne Boswell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Today, I am braindead... I can't seem to find this in Google, and I
> don't remember where I used this code before (so I can't steal it from
> myself). Anyway, all I want to do is:
>
> for i = 0 to 20 step -1
> response.write "<br>" & i
> next
>
> For some reason, that doesn't work. It shows nothing. I know I am
> missing something very simple, but, as I said, today, I am braindead.
>
> --
> Adrienne Boswell at work
> Administrator nextBlock.com
> http://atlas.nextblock.com/files/
> Please respond to the group so others can share
>



 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      08-09-2006

Aaron Bertrand [SQL Server MVP] wote:
> Uh, did you mean for i = 20 to 0 step -1?
>
> If you're going -1 each step, and you start at 0, you're not going to get
> too far.
>


<slaps forehead>Oh my Gosh! Doh! I knew it was something simple.</slap>

Thank you sooo much.



>
> "Adrienne Boswell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Today, I am braindead... I can't seem to find this in Google, and I
> > don't remember where I used this code before (so I can't steal it from
> > myself). Anyway, all I want to do is:
> >
> > for i = 0 to 20 step -1
> > response.write "<br>" & i
> > next
> >
> > For some reason, that doesn't work. It shows nothing. I know I am
> > missing something very simple, but, as I said, today, I am braindead.
> >
> > --
> > Adrienne Boswell at work
> > Administrator nextBlock.com
> > http://atlas.nextblock.com/files/
> > Please respond to the group so others can share
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
How to make a reverse for loop in python? Alex Snast Python 16 09-21-2008 04:34 PM
memory efficiency - for loop with reverse list tuser Perl Misc 2 06-12-2006 04:16 PM
for in loop. reverse traverse R. Rajesh Jeba Anbiah Javascript 3 12-14-2004 10:34 PM
Stacks Queues Reverse Reverse Polish dogbite C++ 4 10-10-2003 05:06 AM



Advertisments