Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Looping Within Loops
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Looping Within Loops

 Post Reply Post Reply
Author
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post Topic: Looping Within Loops
    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
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2005 at 10:14pm
I would try

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


Edited by Phat - 11 March 2005 at 10:15pm
Back to Top
claytone19 View Drop Down
Newbie
Newbie


Joined: 16 February 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote claytone19 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.