Object first in for loop?

Results 1 to 3 of 3

Thread: Object first in for loop?

  1. #1
    Martin, Sweden Guest

    Default Object first in for loop?

    I have problems with getting the last buyed product in my shopping cart system to get first in a for loop (Instead of last)!<BR><BR>The for loop looks like this!<BR>Please help!<BR><BR>Thanks!<BR><BR><BR>&#060;%<BR>If sCartItem = 0 Then<BR>Response.Write ("&#060;option&#062;Empty basket&#060;/option&#062;")<BR>End If<BR>Dim i<BR>For i = 1 To sCartItem<BR>%&#062;<BR>&#060;option&#062;&#060;%= sCart(ProductName,i) %&#062;&#060;/option&#062;<BR>&#060;% Next %&#062;

  2. #2
    Nathen Grass Guest

    Default RE: Object first in for loop?

    Just start from the highest and make your way down to 1.<BR><BR>For i = sCartItem to 1 Step -1<BR>%&#062;<BR>&#060;option&#062;&#060;%= sCart(ProductName,i) %&#062;&#060;/option&#062;<BR>&#060;%next%&#062;

  3. #3
    Martin, Sweden Guest

    Default Thanks Nathen Grass!

    Thanks PAL!<BR>It worked great!<BR>

Posting Permissions

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