Print Page | Close Window

Looping Within Loops

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14206
Printed Date: 30 March 2026 at 11:29am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Looping Within Loops
Posted By: bootcom
Subject: Looping Within Loops
Date Posted: 11 March 2005 at 8:33pm
 Hi, I have a problem at the moment with looping within loops.

I am basically wanting to loop from the current date to a date that the user defines (the easy bit !!). Inside this loop I am wanting to loop invalid dates (which are predefined by the site administrators). Outlined below is how the loops are set out, however I am struggling with only showing dates that are available Sad


' Do the date to max book date loop
For theDate = date() to maxBookDate

' Loop through the invalid days array
For x = 0 to uBound(rsArray, 2)
 
' If the date is not in the array then show it
If NOT rsArray(1, x) = theDate then
 
response.write(theDate)
 
' End the date check function
End If

' Move to next invalid day record
Next

' Loop to the next date
Next


Any help on this one please Sad



Replies:
Posted By: Phat
Date Posted: 11 March 2005 at 10:14pm
I would try

If cstr(rsArray(1, x)) <> cstr(theDate) then


Posted By: claytone19
Date Posted: 11 March 2005 at 10:40pm
This will do it.


dim blnFoundInArray
For theDate = date() to maxBookDate
 
blnFoundInArray = false
  For x = 0 to uBound(rsArray, 2)
    If DateValue(rsArray(1, x)) = DateValue(theDate) then
     
blnFoundInArray = true
      Exit For
    End If
 
Next
   
If blnFoundInArray = false Then Response.Write(theDate)
Next


Posted By: bootcom
Date Posted: 11 March 2005 at 10:55pm
Thanks a lot dude, it all works fine Clap
 
I guess it's not a good idea to be coding for 30 hours solid, you miss the obvious LOL Tongue



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net