|
 |
asp_web_howto thread: Help needed
Message #1 by "Vinnie \(Mailinglists Only\)" <vinnie@j...> on Sat, 21 Sep 2002 08:23:17 +0200
|
|
hi all,
what i would like to do is have small groups of days like
dayname day/month/year
this is almost working fine until I give the subcounter the value "0" (so he will count till 7 days - see blue line).
Then I'm getting the error (see red lien for the code)
Type mismatch: 'the_time'
/main.asp, line 16
about the names:
tm=the month
ty= the year
counter= a simple counter
sc= a subcounter who should count till 7
****************************************************************************************************************************
<%
tm=Month(now())
ty=year(now())
Function LastDayOfMonth(iMonth, iYear)
NextMonth = DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
LastDayOfMonth = Day(DateAdd("d", -1, NextMonth))
End Function
counter_end=LastDayOfMonth(tm,ty) + 1
counter="1"
do until teller= counter_end
sc="1"
do until sc = "7"
the_time=counter & "/" & tm & "/" & ty
the_day=WeekdayName(Weekday(the_time))
response.write " " & the_day & " " & the_time & "<br>"
counter=counter+1
sc=sc+1
loop
response.write "<br>"
loop
%>
Does anybody knows how to solve this ?
Message #2 by Imar Spaanjaars <Imar@S...> on Sat, 21 Sep 2002 10:26:04 +0200
|
|
Hi Vinnie,
I can't see the blue and red lines; I use just plain text in my e-mail program.
Anyway, why are you changing your counters from Integers to Text??
sc="1"
do until sc = "7"
counter=counter+1
sc=sc+1
loop
The value of sc shouldn't be quoted as it's just an Integer
Also, when I ran your code, it tries to loop forever.
do until teller= counter_end
seems undefined so it will never exit the loop.
The fact that the code crashes, is because at some point you are using the
date "31/09/2002" which obviously isn't going to work. Most likely, if
you'd written this code at the beginning of the month, the value 7 would
have worked.... I think this is caused by the LastDayOfMonth and
counter_end stuff, but I am not sure. It looks a bit messy so I can't
really tell what you are doing ;-)
Also, are you using LastDayOfMonth to change global variables? That doesn't
seem like a good idea. Try to let the function return a single variable, or
use ByRef params if you need to pass more than one value outside the function.
If all you're doing is just get the next couple of dates from a certain
starting date, try this:
WriteDates DateValue(DateAdd("d", 20, Now())), 20
WriteDates DateValue(Now()), 20
Function WriteDates(ByVal dtStartDate, ByVal iNumberOfDays)
Dim iLoopCount
For iLoopCount = 0 To iNumberOfDays
Response.Write("Date: " & DateAdd("d", iLoopCount, dtStartDate) &
"<br />")
Next
End Function
HtH
Imar
At 08:23 AM 9/21/2002 +0200, you wrote:
>hi all,
>
>what i would like to do is have small groups of days like
>
>dayname day/month/year
>
>this is almost working fine until I give the subcounter the value "0" (so
>he will count till 7 days - see blue line).
>
>Then I'm getting the error (see red lien for the code)
>
>Type mismatch: 'the_time'
>/main.asp, line 16
>
>
>about the names:
>tm=the month
>ty= the year
>counter= a simple counter
>sc= a subcounter who should count till 7
>****************************************************************************************************************************
>
><%
>tm=Month(now())
>ty=year(now())
>
>Function LastDayOfMonth(iMonth, iYear)
> NextMonth = DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
> LastDayOfMonth = Day(DateAdd("d", -1, NextMonth))
>End Function
>counter_end=LastDayOfMonth(tm,ty) + 1
>counter="1"
>do until teller= counter_end
>sc="1"
> do until sc = "7"
> the_time=counter & "/" & tm & "/" & ty
> the_day=WeekdayName(Weekday(the_time))
> response.write " " & the_day & " " & the_time &
> "<br>"
> counter=counter+1
> sc=sc+1
> loop
> response.write "<br>"
>loop
>%>
>
>
>Does anybody knows how to solve this ?
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20
Message #3 by "vinnie@j... on Sat, 21 Sep 2002 10:40:16 -0400
|
|
Hi Imar,
I'm runnig this code on my webserver who's in dutch=2E
Here in belgium they code for a date is dd/mm/yyyy=2E
It's only when the loop is more than 6 days, the code crashes=2E
what is should do is for example
***********************
monday 1/09/2002
thusday 2/9/2002
=2E=2E=2E=2E
sunday 7/09/2002
**********************
monday 8/09/2002
thusday 2/9/2002
=2E=2E=2E=2E
sunday 14/09/2002
**********************
so thats why I need the loop of 7
Original Message:
-----------------
From: Imar Spaanjaars Imar@S...=2Ecom
Date: Sat, 21 Sep 2002 10:26:04 +0200
To: asp_web_howto@p...=2Ewrox=2Ecom
Subject: [asp_web_howto] Re: Help needed
Hi Vinnie,
I can't see the blue and red lines; I use just plain text in my e-mail
program=2E
Anyway, why are you changing your counters from Integers to Text??
sc=3D"1"
do until sc =3D "7"
counter=3Dcounter+1
sc=3Dsc+1
loop
The value of sc shouldn't be quoted as it's just an Integer
Also, when I ran your code, it tries to loop forever=2E
do until teller=3D counter_end
seems undefined so it will never exit the loop=2E
The fact that the code crashes, is because at some point you are using the
date "31/09/2002" which obviously isn't going to work=2E Most likely, if=20
you'd written this code at the beginning of the month, the value 7 would=20
have worked=2E=2E=2E=2E I think this is caused by the LastDayOfMonth and=20
counter_end stuff, but I am not sure=2E It looks a bit messy so I can't=20
really tell what you are doing ;-)
Also, are you using LastDayOfMonth to change global variables? That doesn'
t
seem like a good idea=2E Try to let the function return a single variable,
or
use ByRef params if you need to pass more than one value outside the
function=2E
If all you're doing is just get the next couple of dates from a certain=20
starting date, try this:
WriteDates DateValue(DateAdd("d", 20, Now())), 20
WriteDates DateValue(Now()), 20
Function WriteDates(ByVal dtStartDate, ByVal iNumberOfDays)
Dim iLoopCount
For iLoopCount =3D 0 To iNumberOfDays
Response=2EWrite("Date: " & DateAdd("d", iLoopCount, dtStartDate)
&
"<br />")
Next
End Function
HtH
Imar
At 08:23 AM 9/21/2002 +0200, you wrote:
>hi all,
>
>what i would like to do is have small groups of days like
>
>dayname day/month/year
>
>this is almost working fine until I give the subcounter the value "0" (so
>he will count till 7 days - see blue line)=2E
>
>Then I'm getting the error (see red lien for the code)
>
>Type mismatch: 'the_time'
>/main=2Easp, line 16
>
>
>about the names:
>tm=3Dthe month
>ty=3D the year
>counter=3D a simple counter
>sc=3D a subcounter who should count till 7
>*************************************************************************
**
*************************************************
>
><%
>tm=3DMonth(now())
>ty=3Dyear(now())
>
>Function LastDayOfMonth(iMonth, iYear)
> NextMonth =3D DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
> LastDayOfMonth =3D Day(DateAdd("d", -1, NextMonth))
>End Function
>counter_end=3DLastDayOfMonth(tm,ty) + 1
>counter=3D"1"
>do until teller=3D counter_end
>sc=3D"1"
> do until sc =3D "7"
> the_time=3Dcounter & "/" & tm & "/" & ty
> the_day=3DWeekdayName(Weekday(the_time))
> response=2Ewrite "=A0=A0=A0=A0" & the_day & " " & the_time &
> "<br>"
> counter=3Dcounter+1
> sc=3Dsc+1
> loop
> response=2Ewrite "<br>"
>loop
>%>
>
>
>Does anybody knows how to solve this ?
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus=2E
>
>Usable Web Menus
>http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprog
ramme
>r-20
>Constructing Accessible Web Sites
>http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprog
ramme
>r-20
>Practical JavaScript for the Usable Web
>http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprog
ramme
>r-20
>---
>Change your mail options at http://p2p=2Ewrox=2Ecom/manager=2Easp or
>to unsubscribe send a blank email to %%email=2Eunsub%%=2E
---
Improve your web design skills with these new books from Glasshaus=2E
Usable Web Menus
http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogr
amme
r-20
Constructing Accessible Web Sites
http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogr
amme
r-20
Practical JavaScript for the Usable Web
http://www=2Eamazon=2Ecom/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogr
amme
r-20
---
Change your mail options at http://p2p=2Ewrox=2Ecom/manager=2Easp or
leave-asp_web_howto-802861P@p...=2Ewrox=2Ecom=2E
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web=2Ecom/ =2E
Message #4 by Imar Spaanjaars <Imar@S...> on Sat, 21 Sep 2002 17:35:30 +0200
|
|
But what is it you are trying to accomplish? What exactly is the code
supposed to do?
From your code, I can't extract your business logic, so I can't help you
with it right now. Can you specify your needs a little more?
(Je moet ff uitleggen (in het engels) wat je precies wil , anders snap ik
er geen bal van ;-) )
Cheers,
Imar
At 10:40 AM 9/21/2002 -0400, you wrote:
>Hi Imar,
>
>I'm runnig this code on my webserver who's in dutch.
>Here in belgium they code for a date is dd/mm/yyyy.
>It's only when the loop is more than 6 days, the code crashes.
>
>what is should do is for example
>
>***********************
>monday 1/09/2002
>thusday 2/9/2002
>....
>sunday 7/09/2002
>**********************
>monday 8/09/2002
>thusday 2/9/2002
>....
>sunday 14/09/2002
>**********************
>
>so thats why I need the loop of 7
>
>Original Message:
>-----------------
>From: Imar Spaanjaars Imar@S...
>Date: Sat, 21 Sep 2002 10:26:04 +0200
>To: asp_web_howto@p...
>Subject: [asp_web_howto] Re: Help needed
>
>
>Hi Vinnie,
>
>I can't see the blue and red lines; I use just plain text in my e-mail
>program.
>
>Anyway, why are you changing your counters from Integers to Text??
>
>sc="1"
> do until sc = "7"
>
> counter=counter+1
> sc=sc+1
>loop
>
>The value of sc shouldn't be quoted as it's just an Integer
>
>Also, when I ran your code, it tries to loop forever.
>
> do until teller= counter_end
>
>seems undefined so it will never exit the loop.
>
>The fact that the code crashes, is because at some point you are using the
>date "31/09/2002" which obviously isn't going to work. Most likely, if
>you'd written this code at the beginning of the month, the value 7 would
>have worked.... I think this is caused by the LastDayOfMonth and
>counter_end stuff, but I am not sure. It looks a bit messy so I can't
>really tell what you are doing ;-)
>
>Also, are you using LastDayOfMonth to change global variables? That doesn't
>seem like a good idea. Try to let the function return a single variable, or
>use ByRef params if you need to pass more than one value outside the
>function.
>
>If all you're doing is just get the next couple of dates from a certain
>starting date, try this:
>
>
>WriteDates DateValue(DateAdd("d", 20, Now())), 20
>WriteDates DateValue(Now()), 20
>
>Function WriteDates(ByVal dtStartDate, ByVal iNumberOfDays)
> Dim iLoopCount
> For iLoopCount = 0 To iNumberOfDays
> Response.Write("Date: " & DateAdd("d", iLoopCount, dtStartDate) &
>"<br />")
> Next
>End Function
>
>
>HtH
>
>Imar
>
>
>
>At 08:23 AM 9/21/2002 +0200, you wrote:
> >hi all,
> >
> >what i would like to do is have small groups of days like
> >
> >dayname day/month/year
> >
> >this is almost working fine until I give the subcounter the value "0" (so
> >he will count till 7 days - see blue line).
> >
> >Then I'm getting the error (see red lien for the code)
> >
> >Type mismatch: 'the_time'
> >/main.asp, line 16
> >
> >
> >about the names:
> >tm=the month
> >ty= the year
> >counter= a simple counter
> >sc= a subcounter who should count till 7
> >***************************************************************************
>*************************************************
> >
> ><%
> >tm=Month(now())
> >ty=year(now())
> >
> >Function LastDayOfMonth(iMonth, iYear)
> > NextMonth = DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
> > LastDayOfMonth = Day(DateAdd("d", -1, NextMonth))
> >End Function
> >counter_end=LastDayOfMonth(tm,ty) + 1
> >counter="1"
> >do until teller= counter_end
> >sc="1"
> > do until sc = "7"
> > the_time=counter & "/" & tm & "/" & ty
> > the_day=WeekdayName(Weekday(the_time))
> > response.write " " & the_day & " " & the_time &
> > "<br>"
> > counter=counter+1
> > sc=sc+1
> > loop
> > response.write "<br>"
> >loop
> >%>
> >
> >
> >Does anybody knows how to solve this ?
> >
> >
> >
> >---
> >
> >Improve your web design skills with these new books from Glasshaus.
> >
> >Usable Web Menus
> >http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> >r-20
> >Constructing Accessible Web Sites
> >http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> >r-20
> >Practical JavaScript for the Usable Web
> >http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> >r-20
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20
>
>--------------------------------------------------------------------
>mail2web - Check your email from the web at
>http://mail2web.com/ .
>
>
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20
Message #5 by "Vinnie \(Mailinglists Only\)" <vinnie@j...> on Sat, 21 Sep 2002 20:45:35 +0200
|
|
Hi Imar,
what the code should do is have agenda like i have now on
http://www16.brinkster.com/sjatooweb/ and the code works now.
On the left side you can see that he displays the days according the month.
That's what I wanted to do
Thanks anyway to help me.
Vinnie
----- Original Message -----
From: "Imar Spaanjaars" <Imar@S...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, September 21, 2002 5:35 PM
Subject: [asp_web_howto] Re: Help needed
> But what is it you are trying to accomplish? What exactly is the code
> supposed to do?
>
> From your code, I can't extract your business logic, so I can't help you
> with it right now. Can you specify your needs a little more?
> (Je moet ff uitleggen (in het engels) wat je precies wil , anders snap ik
> er geen bal van ;-) )
>
> Cheers,
>
> Imar
>
>
> At 10:40 AM 9/21/2002 -0400, you wrote:
> >Hi Imar,
> >
> >I'm runnig this code on my webserver who's in dutch.
> >Here in belgium they code for a date is dd/mm/yyyy.
> >It's only when the loop is more than 6 days, the code crashes.
> >
> >what is should do is for example
> >
> >***********************
> >monday 1/09/2002
> >thusday 2/9/2002
> >....
> >sunday 7/09/2002
> >**********************
> >monday 8/09/2002
> >thusday 2/9/2002
> >....
> >sunday 14/09/2002
> >**********************
> >
> >so thats why I need the loop of 7
> >
> >Original Message:
> >-----------------
> >From: Imar Spaanjaars Imar@S...
> >Date: Sat, 21 Sep 2002 10:26:04 +0200
> >To: asp_web_howto@p...
> >Subject: [asp_web_howto] Re: Help needed
> >
> >
> >Hi Vinnie,
> >
> >I can't see the blue and red lines; I use just plain text in my e-mail
> >program.
> >
> >Anyway, why are you changing your counters from Integers to Text??
> >
> >sc="1"
> > do until sc = "7"
> >
> > counter=counter+1
> > sc=sc+1
> >loop
> >
> >The value of sc shouldn't be quoted as it's just an Integer
> >
> >Also, when I ran your code, it tries to loop forever.
> >
> > do until teller= counter_end
> >
> >seems undefined so it will never exit the loop.
> >
> >The fact that the code crashes, is because at some point you are using
the
> >date "31/09/2002" which obviously isn't going to work. Most likely, if
> >you'd written this code at the beginning of the month, the value 7 would
> >have worked.... I think this is caused by the LastDayOfMonth and
> >counter_end stuff, but I am not sure. It looks a bit messy so I can't
> >really tell what you are doing ;-)
> >
> >Also, are you using LastDayOfMonth to change global variables? That
doesn't
> >seem like a good idea. Try to let the function return a single variable,
or
> >use ByRef params if you need to pass more than one value outside the
> >function.
> >
> >If all you're doing is just get the next couple of dates from a certain
> >starting date, try this:
> >
> >
> >WriteDates DateValue(DateAdd("d", 20, Now())), 20
> >WriteDates DateValue(Now()), 20
> >
> >Function WriteDates(ByVal dtStartDate, ByVal iNumberOfDays)
> > Dim iLoopCount
> > For iLoopCount = 0 To iNumberOfDays
> > Response.Write("Date: " & DateAdd("d", iLoopCount, dtStartDate)
&
> >"<br />")
> > Next
> >End Function
> >
> >
> >HtH
> >
> >Imar
> >
> >
> >
> >At 08:23 AM 9/21/2002 +0200, you wrote:
> > >hi all,
> > >
> > >what i would like to do is have small groups of days like
> > >
> > >dayname day/month/year
> > >
> > >this is almost working fine until I give the subcounter the value "0"
(so
> > >he will count till 7 days - see blue line).
> > >
> > >Then I'm getting the error (see red lien for the code)
> > >
> > >Type mismatch: 'the_time'
> > >/main.asp, line 16
> > >
> > >
> > >about the names:
> > >tm=the month
> > >ty= the year
> > >counter= a simple counter
> > >sc= a subcounter who should count till 7
> >
>***************************************************************************
> >*************************************************
> > >
> > ><%
> > >tm=Month(now())
> > >ty=year(now())
> > >
> > >Function LastDayOfMonth(iMonth, iYear)
> > > NextMonth = DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
> > > LastDayOfMonth = Day(DateAdd("d", -1, NextMonth))
> > >End Function
> > >counter_end=LastDayOfMonth(tm,ty) + 1
> > >counter="1"
> > >do until teller= counter_end
> > >sc="1"
> > > do until sc = "7"
> > > the_time=counter & "/" & tm & "/" & ty
> > > the_day=WeekdayName(Weekday(the_time))
> > > response.write " " & the_day & " " & the_time &
> > > "<br>"
> > > counter=counter+1
> > > sc=sc+1
> > > loop
> > > response.write "<br>"
> > >loop
> > >%>
> > >
> > >
> > >Does anybody knows how to solve this ?
> > >
> > >
> > >
> > >---
> > >
> > >Improve your web design skills with these new books from Glasshaus.
> > >
> > >Usable Web Menus
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> > >r-20
> > >Constructing Accessible Web Sites
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> > >r-20
> > >Practical JavaScript for the Usable Web
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> > >r-20
> >
> >
> >
> >
> >---
> >
> >Improve your web design skills with these new books from Glasshaus.
> >
> >Usable Web Menus
> >http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> >r-20
> >Constructing Accessible Web Sites
> >http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> >r-20
> >Practical JavaScript for the Usable Web
> >http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> >r-20
> >
> >--------------------------------------------------------------------
> >mail2web - Check your email from the web at
> >http://mail2web.com/ .
> >
> >
> >
> >
> >---
> >
> >Improve your web design skills with these new books from Glasshaus.
> >
> >Usable Web Menus
> >http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> >r-20
> >Constructing Accessible Web Sites
> >http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> >r-20
> >Practical JavaScript for the Usable Web
> >http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> >r-20
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
Message #6 by "Drew, Ron" <RDrew@B...> on Mon, 23 Sep 2002 08:26:30 -0400
|
|
It's a biggie ..but it works ...just add your own icon for
how-calendar.gif...to select calendar... 2 steps
First executes the calendar.
Second is the calendar with date selections...
..............................Step 1....this one is small.....
<html><HEAD>
<script language=3D"JavaScript" src=3D"date-picker.js"></script>
</HEAD>
<BODY><center>
<form name=3Dcalform>
<input type=3Dtext name=3D"datebox" size=3D15><a
href=3D"javascript:show_calendar('calform.datebox');"
onmouseover=3D"window.status=3D'Date Picker';return true;"
onmouseout=3D"window.status=3D'';return true;"><img
src=3D"show-calendar.gif"
width=3D24 height=3D22 border=3D0></a>
</form>
</center>
</form></body></html>
...........................Step 2 ...here's the biggie....do a cut and
paste
var weekend =3D [0,6];
var weekendColor =3D "#e0e0e0";
var fontface =3D "Verdana";
var fontsize =3D 2;
var gNow =3D new Date();
var ggWinCal;
isNav =3D (navigator.appName.indexOf("Netscape") !=3D -1) ? true :
false;
isIE =3D (navigator.appName.indexOf("Microsoft") !=3D -1) ? true :
false;
Calendar.Months =3D ["January", "February", "March", "April", "May",
"June",
"July", "August", "September", "October", "November", "December"];
// Non-Leap year Month days..
Calendar.DOMonth =3D [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Leap year Month days..
Calendar.lDOMonth =3D [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function Calendar(p_item, p_WinCal, p_month, p_year, p_format) {
if ((p_month =3D=3D null) && (p_year =3D=3D null)) return;
if (p_WinCal =3D=3D null)
this.gWinCal =3D ggWinCal;
else
this.gWinCal =3D p_WinCal;
=09
if (p_month =3D=3D null) {
this.gMonthName =3D null;
this.gMonth =3D null;
this.gYearly =3D true;
} else {
this.gMonthName =3D Calendar.get_month(p_month);
this.gMonth =3D new Number(p_month);
this.gYearly =3D false;
}
this.gYear =3D p_year;
this.gFormat =3D p_format;
this.gBGColor =3D "white";
this.gFGColor =3D "black";
this.gTextColor =3D "black";
this.gHeaderColor =3D "black";
this.gReturnItem =3D p_item;
}
Calendar.get_month =3D Calendar_get_month;
Calendar.get_daysofmonth =3D Calendar_get_daysofmonth;
Calendar.calc_month_year =3D Calendar_calc_month_year;
Calendar.print =3D Calendar_print;
function Calendar_get_month(monthNo) {
return Calendar.Months[monthNo];
}
function Calendar_get_daysofmonth(monthNo, p_year) {
/*
Check for leap year ..
1.Years evenly divisible by four are normally leap years, except
for...
2.Years also evenly divisible by 100 are not leap years, except
for...
3.Years also evenly divisible by 400 are leap years.
*/
if ((p_year % 4) =3D=3D 0) {
if ((p_year % 100) =3D=3D 0 && (p_year % 400) !=3D 0)
return Calendar.DOMonth[monthNo];
=09
return Calendar.lDOMonth[monthNo];
} else
return Calendar.DOMonth[monthNo];
}
function Calendar_calc_month_year(p_Month, p_Year, incr) {
/*
Will return an 1-D array with 1st element being the calculated
month
and second being the calculated year
after applying the month increment/decrement as specified by
'incr' parameter.
'incr' will normally have 1/-1 to navigate thru the months.
*/
var ret_arr =3D new Array();
=09
if (incr =3D=3D -1) {
// B A C K W A R D
if (p_Month =3D=3D 0) {
ret_arr[0] =3D 11;
ret_arr[1] =3D parseInt(p_Year) - 1;
}
else {
ret_arr[0] =3D parseInt(p_Month) - 1;
ret_arr[1] =3D parseInt(p_Year);
}
} else if (incr =3D=3D 1) {
// F O R W A R D
if (p_Month =3D=3D 11) {
ret_arr[0] =3D 0;
ret_arr[1] =3D parseInt(p_Year) + 1;
}
else {
ret_arr[0] =3D parseInt(p_Month) + 1;
ret_arr[1] =3D parseInt(p_Year);
}
}
=09
return ret_arr;
}
function Calendar_print() {
ggWinCal.print();
}
function Calendar_calc_month_year(p_Month, p_Year, incr) {
/*
Will return an 1-D array with 1st element being the calculated
month
and second being the calculated year
after applying the month increment/decrement as specified by
'incr' parameter.
'incr' will normally have 1/-1 to navigate thru the months.
*/
var ret_arr =3D new Array();
=09
if (incr =3D=3D -1) {
// B A C K W A R D
if (p_Month =3D=3D 0) {
ret_arr[0] =3D 11;
ret_arr[1] =3D parseInt(p_Year) - 1;
}
else {
ret_arr[0] =3D parseInt(p_Month) - 1;
ret_arr[1] =3D parseInt(p_Year);
}
} else if (incr =3D=3D 1) {
// F O R W A R D
if (p_Month =3D=3D 11) {
ret_arr[0] =3D 0;
ret_arr[1] =3D parseInt(p_Year) + 1;
}
else {
ret_arr[0] =3D parseInt(p_Month) + 1;
ret_arr[1] =3D parseInt(p_Year);
}
}
=09
return ret_arr;
}
// This is for compatibility with Navigator 3, we have to create and
discard one object before the prototype object exists.
new Calendar();
Calendar.prototype.getMonthlyCalendarCode =3D function() {
var vCode =3D "";
var vHeader_Code =3D "";
var vData_Code =3D "";
=09
// Begin Table Drawing code here..
vCode =3D vCode + "<TABLE BORDER=3D1 BGCOLOR=3D\"" + this.gBGColor +
"\">";
=09
vHeader_Code =3D this.cal_header();
vData_Code =3D this.cal_data();
vCode =3D vCode + vHeader_Code + vData_Code;
=09
vCode =3D vCode + "</TABLE>";
=09
return vCode;
}
Calendar.prototype.show =3D function() {
var vCode =3D "";
=09
this.gWinCal.document.open();
// Setup the page...
this.wwrite("<html>");
this.wwrite("<head><title>Calendar</title>");
this.wwrite("</head>");
this.wwrite("<body " +
"link=3D\"" + this.gLinkColor + "\" " +
"vlink=3D\"" + this.gLinkColor + "\" " +
"alink=3D\"" + this.gLinkColor + "\" " +
"text=3D\"" + this.gTextColor + "\">");
this.wwriteA("<FONT FACE=3D'" + fontface + "' SIZE=3D2><B>");
this.wwriteA(this.gMonthName + " " + this.gYear);
this.wwriteA("</B><BR>");
// Show navigation buttons
var prevMMYYYY =3D Calendar.calc_month_year(this.gMonth,
this.gYear, -1);
var prevMM =3D prevMMYYYY[0];
var prevYYYY =3D prevMMYYYY[1];
var nextMMYYYY =3D Calendar.calc_month_year(this.gMonth,
this.gYear, 1);
var nextMM =3D nextMMYYYY[0];
var nextYYYY =3D nextMMYYYY[1];
=09
this.wwrite("<TABLE WIDTH=3D'100%' BORDER=3D1 CELLSPACING=3D0
CELLPADDING=3D0 BGCOLOR=3D'#e0e0e0'><TR><TD ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" +
(parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
");" +
"\"><<<\/A>]</TD><TD ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', '" + prevMM + "', '" +
prevYYYY + "', '" + this.gFormat + "'" +
");" +
"\"><<\/A>]</TD><TD ALIGN=3Dcenter>");
this.wwrite("[<A
HREF=3D\"javascript:window.print();\">Print</A>]</TD><TD
ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', '" + nextMM + "', '" +
nextYYYY + "', '" + this.gFormat + "'" +
");" +
"\">><\/A>]</TD><TD ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" +
(parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" +
");" +
"\">>><\/A>]</TD></TR></TABLE><BR>");
// Get the complete calendar code for the month..
vCode =3D this.getMonthlyCalendarCode();
this.wwrite(vCode);
this.wwrite("</font></body></html>");
this.gWinCal.document.close();
}
Calendar.prototype.showY =3D function() {
var vCode =3D "";
var i;
var vr, vc, vx, vy; // Row, Column, X-coord, Y-coord
var vxf =3D 285; // X-Factor
var vyf =3D 200; // Y-Factor
var vxm =3D 10; // X-margin
var vym; // Y-margin
if (isIE) vym =3D 75;
else if (isNav) vym =3D 25;
=09
this.gWinCal.document.open();
this.wwrite("<html>");
this.wwrite("<head><title>Calendar</title>");
this.wwrite("<style type=3D'text/css'>\n<!--");
for (i=3D0; i<12; i++) {
vc =3D i % 3;
if (i>=3D0 && i<=3D 2) vr =3D 0;
if (i>=3D3 && i<=3D 5) vr =3D 1;
if (i>=3D6 && i<=3D 8) vr =3D 2;
if (i>=3D9 && i<=3D 11) vr =3D 3;
=09
vx =3D parseInt(vxf * vc) + vxm;
vy =3D parseInt(vyf * vr) + vym;
this.wwrite(".lclass" + i + " {position:absolute;top:" +
vy + ";left:" + vx + ";}");
}
this.wwrite("-->\n</style>");
this.wwrite("</head>");
this.wwrite("<body " +
"link=3D\"" + this.gLinkColor + "\" " +
"vlink=3D\"" + this.gLinkColor + "\" " +
"alink=3D\"" + this.gLinkColor + "\" " +
"text=3D\"" + this.gTextColor + "\">");
this.wwrite("<FONT FACE=3D'" + fontface + "' SIZE=3D2><B>");
this.wwrite("Year : " + this.gYear);
this.wwrite("</B><BR>");
// Show navigation buttons
var prevYYYY =3D parseInt(this.gYear) - 1;
var nextYYYY =3D parseInt(this.gYear) + 1;
=09
this.wwrite("<TABLE WIDTH=3D'100%' BORDER=3D1 CELLSPACING=3D0
CELLPADDING=3D0 BGCOLOR=3D'#e0e0e0'><TR><TD ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', null, '" + prevYYYY + "',
'" + this.gFormat + "'" +
");" +
"\" alt=3D'Prev Year'><<<\/A>]</TD><TD ALIGN=3Dcenter>");
this.wwrite("[<A
HREF=3D\"javascript:window.print();\">Print</A>]</TD><TD
ALIGN=3Dcenter>");
this.wwrite("[<A HREF=3D\"" +
"javascript:window.opener.Build(" +
"'" + this.gReturnItem + "', null, '" + nextYYYY + "',
'" + this.gFormat + "'" +
");" +
"\">>><\/A>]</TD></TR></TABLE><BR>");
// Get the complete calendar code for each month..
var j;
for (i=3D11; i>=3D0; i--) {
if (isIE)
this.wwrite("<DIV ID=3D\"layer" + i + "\"
CLASS=3D\"lclass" + i + "\">");
else if (isNav)
this.wwrite("<LAYER ID=3D\"layer" + i + "\"
CLASS=3D\"lclass" + i + "\">");
this.gMonth =3D i;
this.gMonthName =3D Calendar.get_month(this.gMonth);
vCode =3D this.getMonthlyCalendarCode();
this.wwrite(this.gMonthName + "/" + this.gYear +
"<BR>");
this.wwrite(vCode);
if (isIE)
this.wwrite("</DIV>");
else if (isNav)
this.wwrite("</LAYER>");
}
this.wwrite("</font><BR></body></html>");
this.gWinCal.document.close();
}
Calendar.prototype.wwrite =3D function(wtext) {
this.gWinCal.document.writeln(wtext);
}
Calendar.prototype.wwriteA =3D function(wtext) {
this.gWinCal.document.write(wtext);
}
Calendar.prototype.cal_header =3D function() {
var vCode =3D "";
=09
vCode =3D vCode + "<TR>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Sun</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Mon</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Tue</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Wed</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Thu</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'14%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Fri</B></FONT></TD>";
vCode =3D vCode + "<TD WIDTH=3D'16%'><FONT SIZE=3D'2' FACE=3D'" +
fontface + "' COLOR=3D'" + this.gHeaderColor +
"'><B>Sat</B></FONT></TD>";
vCode =3D vCode + "</TR>";
=09
return vCode;
}
Calendar.prototype.cal_data =3D function() {
var vDate =3D new Date();
vDate.setDate(1);
vDate.setMonth(this.gMonth);
vDate.setFullYear(this.gYear);
var vFirstDay=3DvDate.getDay();
var vDay=3D1;
var vLastDay=3DCalendar.get_daysofmonth(this.gMonth, this.gYear);
var vOnLastDay=3D0;
var vCode =3D "";
/*
Get day for the 1st of the requested month/year..
Place as many blank cells before the 1st day of the month as
necessary.
*/
vCode =3D vCode + "<TR>";
for (i=3D0; i<vFirstDay; i++) {
vCode =3D vCode + "<TD WIDTH=3D'14%'" +
this.write_weekend_string(i) + "><FONT SIZE=3D'2' FACE=3D'" + fontface +
"'>
</FONT></TD>";
}
// Write rest of the 1st week
for (j=3DvFirstDay; j<7; j++) {
vCode =3D vCode + "<TD WIDTH=3D'14%'" +
this.write_weekend_string(j) + "><FONT SIZE=3D'2' FACE=3D'" + fontface +
"'>" +
"<A HREF=3D'#' " +
"onClick=3D\"self.opener.document." +
this.gReturnItem + ".value=3D'" +
this.format_data(vDay) +
"';window.close();\">" +
this.format_day(vDay) +
"</A>" +
"</FONT></TD>";
vDay=3DvDay + 1;
}
vCode =3D vCode + "</TR>";
// Write the rest of the weeks
for (k=3D2; k<7; k++) {
vCode =3D vCode + "<TR>";
for (j=3D0; j<7; j++) {
vCode =3D vCode + "<TD WIDTH=3D'14%'" +
this.write_weekend_string(j) + "><FONT SIZE=3D'2' FACE=3D'" + fontface +
"'>" +
"<A HREF=3D'#' " +
=09
"onClick=3D\"self.opener.document." + this.gReturnItem + ".value=3D'" +
this.format_data(vDay) +
"';window.close();\">" +
this.format_day(vDay) +
"</A>" +
"</FONT></TD>";
vDay=3DvDay + 1;
if (vDay > vLastDay) {
vOnLastDay =3D 1;
break;
}
}
if (j =3D=3D 6)
vCode =3D vCode + "</TR>";
if (vOnLastDay =3D=3D 1)
break;
}
=09
// Fill up the rest of last week with proper blanks, so that we
get proper square blocks
for (m=3D1; m<(7-j); m++) {
if (this.gYearly)
vCode =3D vCode + "<TD WIDTH=3D'14%'" +
this.write_weekend_string(j+m) +
"><FONT SIZE=3D'2' FACE=3D'" + fontface + "'
COLOR=3D'gray'> </FONT></TD>";
else
vCode =3D vCode + "<TD WIDTH=3D'14%'" +
this.write_weekend_string(j+m) +
"><FONT SIZE=3D'2' FACE=3D'" + fontface + "'
COLOR=3D'gray'>" + m + "</FONT></TD>";
}
=09
return vCode;
}
Calendar.prototype.format_day =3D function(vday) {
var vNowDay =3D gNow.getDate();
var vNowMonth =3D gNow.getMonth();
var vNowYear =3D gNow.getFullYear();
if (vday =3D=3D vNowDay && this.gMonth =3D=3D vNowMonth && this.gYear
=3D=3D
vNowYear)
return ("<FONT COLOR=3D\"RED\"><B>" + vday +
"</B></FONT>");
else
return (vday);
}
Calendar.prototype.write_weekend_string =3D function(vday) {
var i;
// Return special formatting for the weekend day.
for (i=3D0; i<weekend.length; i++) {
if (vday =3D=3D weekend[i])
return (" BGCOLOR=3D\"" + weekendColor + "\"");
}
=09
return "";
}
Calendar.prototype.format_data =3D function(p_day) {
var vData;
var vMonth =3D 1 + this.gMonth;
vMonth =3D (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
var vMon =3D
Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
var vFMon =3D Calendar.get_month(this.gMonth).toUpperCase();
var vY4 =3D new String(this.gYear);
var vY2 =3D new String(this.gYear.substr(2,2));
var vDD =3D (p_day.toString().length < 2) ? "0" + p_day : p_day;
switch (this.gFormat) {
case "MM\/DD\/YYYY" :
vData =3D vMonth + "\/" + vDD + "\/" + vY4;
break;
case "MM\/DD\/YY" :
vData =3D vMonth + "\/" + vDD + "\/" + vY2;
break;
case "MM-DD-YYYY" :
vData =3D vMonth + "-" + vDD + "-" + vY4;
break;
case "MM-DD-YY" :
vData =3D vMonth + "-" + vDD + "-" + vY2;
break;
case "DD\/MON\/YYYY" :
vData =3D vDD + "\/" + vMon + "\/" + vY4;
break;
case "DD\/MON\/YY" :
vData =3D vDD + "\/" + vMon + "\/" + vY2;
break;
case "DD-MON-YYYY" :
vData =3D vDD + "-" + vMon + "-" + vY4;
break;
case "DD-MON-YY" :
vData =3D vDD + "-" + vMon + "-" + vY2;
break;
case "DD\/MONTH\/YYYY" :
vData =3D vDD + "\/" + vFMon + "\/" + vY4;
break;
case "DD\/MONTH\/YY" :
vData =3D vDD + "\/" + vFMon + "\/" + vY2;
break;
case "DD-MONTH-YYYY" :
vData =3D vDD + "-" + vFMon + "-" + vY4;
break;
case "DD-MONTH-YY" :
vData =3D vDD + "-" + vFMon + "-" + vY2;
break;
case "DD\/MM\/YYYY" :
vData =3D vDD + "\/" + vMonth + "\/" + vY4;
break;
case "DD\/MM\/YY" :
vData =3D vDD + "\/" + vMonth + "\/" + vY2;
break;
case "DD-MM-YYYY" :
vData =3D vDD + "-" + vMonth + "-" + vY4;
break;
case "DD-MM-YY" :
vData =3D vDD + "-" + vMonth + "-" + vY2;
break;
default :
vData =3D vMonth + "\/" + vDD + "\/" + vY4;
}
return vData;
}
function Build(p_item, p_month, p_year, p_format) {
var p_WinCal =3D ggWinCal;
gCal =3D new Calendar(p_item, p_WinCal, p_month, p_year,
p_format);
// Customize your Calendar here..
gCal.gBGColor=3D"white";
gCal.gLinkColor=3D"black";
gCal.gTextColor=3D"black";
gCal.gHeaderColor=3D"darkgreen";
// Choose appropriate show function
if (gCal.gYearly) gCal.showY();
else gCal.show();
}
function show_calendar() {
/*
p_month : 0-11 for Jan-Dec; 12 for All Months.
p_year : 4-digit year
p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...)
p_item : Return Item.
*/
p_item =3D arguments[0];
if (arguments[1] =3D=3D null)
p_month =3D new String(gNow.getMonth());
else
p_month =3D arguments[1];
if (arguments[2] =3D=3D "" || arguments[2] =3D=3D null)
p_year =3D new String(gNow.getFullYear().toString());
else
p_year =3D arguments[2];
if (arguments[3] =3D=3D null)
p_format =3D "MM/DD/YYYY";
else
p_format =3D arguments[3];
vWinCal =3D window.open("", "Calendar",
=09
"width=3D250,height=3D250,status=3Dno,resizable=3Dno,top=3D200,left=3D200
");
vWinCal.opener =3D self;
ggWinCal =3D vWinCal;
Build(p_item, p_month, p_year, p_format);
}
/*
Yearly Calendar Code Starts here
*/
function show_yearly_calendar(p_item, p_year, p_format) {
// Load the defaults..
if (p_year =3D=3D null || p_year =3D=3D "")
p_year =3D new String(gNow.getFullYear().toString());
if (p_format =3D=3D null || p_format =3D=3D "")
p_format =3D "MM/DD/YYYY";
var vWinCal =3D window.open("", "Calendar", "scrollbars=3Dyes");
vWinCal.opener =3D self;
ggWinCal =3D vWinCal;
Build(p_item, null, p_year, p_format);
}
...................................the
end....phuh...............................................
-----Original Message-----
From: Vinnie (Mailinglists Only) [mailto:vinnie@j...]
Sent: Saturday, September 21, 2002 2:46 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: Help needed
Hi Imar,
what the code should do is have agenda like i have now on
http://www16.brinkster.com/sjatooweb/ and the code works now.
On the left side you can see that he displays the days according the
month.
That's what I wanted to do
Thanks anyway to help me.
Vinnie
----- Original Message -----
From: "Imar Spaanjaars" <Imar@S...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, September 21, 2002 5:35 PM
Subject: [asp_web_howto] Re: Help needed
> But what is it you are trying to accomplish? What exactly is the code
> supposed to do?
>
> From your code, I can't extract your business logic, so I can't help
you
> with it right now. Can you specify your needs a little more?
> (Je moet ff uitleggen (in het engels) wat je precies wil , anders snap
ik
> er geen bal van ;-) )
>
> Cheers,
>
> Imar
>
>
> At 10:40 AM 9/21/2002 -0400, you wrote:
> >Hi Imar,
> >
> >I'm runnig this code on my webserver who's in dutch.
> >Here in belgium they code for a date is dd/mm/yyyy.
> >It's only when the loop is more than 6 days, the code crashes.
> >
> >what is should do is for example
> >
> >***********************
> >monday 1/09/2002
> >thusday 2/9/2002
> >....
> >sunday 7/09/2002
> >**********************
> >monday 8/09/2002
> >thusday 2/9/2002
> >....
> >sunday 14/09/2002
> >**********************
> >
> >so thats why I need the loop of 7
> >
> >Original Message:
> >-----------------
> >From: Imar Spaanjaars Imar@S...
> >Date: Sat, 21 Sep 2002 10:26:04 +0200
> >To: asp_web_howto@p...
> >Subject: [asp_web_howto] Re: Help needed
> >
> >
> >Hi Vinnie,
> >
> >I can't see the blue and red lines; I use just plain text in my
e-mail
> >program.
> >
> >Anyway, why are you changing your counters from Integers to Text??
> >
> >sc=3D"1"
> > do until sc =3D "7"
> >
> > counter=3Dcounter+1
> > sc=3Dsc+1
> >loop
> >
> >The value of sc shouldn't be quoted as it's just an Integer
> >
> >Also, when I ran your code, it tries to loop forever.
> >
> > do until teller=3D counter_end
> >
> >seems undefined so it will never exit the loop.
> >
> >The fact that the code crashes, is because at some point you are
using
the
> >date "31/09/2002" which obviously isn't going to work. Most likely,
if
> >you'd written this code at the beginning of the month, the value 7
would
> >have worked.... I think this is caused by the LastDayOfMonth and
> >counter_end stuff, but I am not sure. It looks a bit messy so I can't
> >really tell what you are doing ;-)
> >
> >Also, are you using LastDayOfMonth to change global variables? That
doesn't
> >seem like a good idea. Try to let the function return a single
variable,
or
> >use ByRef params if you need to pass more than one value outside the
> >function.
> >
> >If all you're doing is just get the next couple of dates from a
certain
> >starting date, try this:
> >
> >
> >WriteDates DateValue(DateAdd("d", 20, Now())), 20
> >WriteDates DateValue(Now()), 20
> >
> >Function WriteDates(ByVal dtStartDate, ByVal iNumberOfDays)
> > Dim iLoopCount
> > For iLoopCount =3D 0 To iNumberOfDays
> > Response.Write("Date: " & DateAdd("d", iLoopCount,
dtStartDate)
&
> >"<br />")
> > Next
> >End Function
> >
> >
> >HtH
> >
> >Imar
> >
> >
> >
> >At 08:23 AM 9/21/2002 +0200, you wrote:
> > >hi all,
> > >
> > >what i would like to do is have small groups of days like
> > >
> > >dayname day/month/year
> > >
> > >this is almost working fine until I give the subcounter the value
"0"
(so
> > >he will count till 7 days - see blue line).
> > >
> > >Then I'm getting the error (see red lien for the code)
> > >
> > >Type mismatch: 'the_time'
> > >/main.asp, line 16
> > >
> > >
> > >about the names:
> > >tm=3Dthe month
> > >ty=3D the year
> > >counter=3D a simple counter
> > >sc=3D a subcounter who should count till 7
> >
>***********************************************************************
****
> >*************************************************
> > >
> > ><%
> > >tm=3DMonth(now())
> > >ty=3Dyear(now())
> > >
> > >Function LastDayOfMonth(iMonth, iYear)
> > > NextMonth =3D DateAdd("m", 1, DateSerial(iYear, iMonth, "01"))
> > > LastDayOfMonth =3D Day(DateAdd("d", -1, NextMonth))
> > >End Function
> > >counter_end=3DLastDayOfMonth(tm,ty) + 1
> > >counter=3D"1"
> > >do until teller=3D counter_end
> > >sc=3D"1"
> > > do until sc =3D "7"
> > > the_time=3Dcounter & "/" & tm & "/" & ty
> > > the_day=3DWeekdayName(Weekday(the_time))
> > > response.write " " & the_day & " " & the_time &
> > > "<br>"
> > > counter=3Dcounter+1
> > > sc=3Dsc+1
> > > loop
> > > response.write "<br>"
> > >loop
> > >%>
> > >
> > >
> > >Does anybody knows how to solve this ?
> > >
> > >
> > >
> > >---
> > >
> > >Improve your web design skills with these new books from Glasshaus.
> > >
> > >Usable Web Menus
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogram
m
e
> > >r-20
> > >Constructing Accessible Web Sites
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogram
m
e
> > >r-20
> > >Practical JavaScript for the Usable Web
> >
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogram
m
e
> > >r-20
> >
> >
> >
> >
> >---
> >
> >Improve your web design skills with these new books from Glasshaus.
> >
> >Usable Web Menus
>
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogram
m
e
> >r-20
> >Constructing Accessible Web Sites
>
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogram
m
e
> >r-20
> >Practical JavaScript for the Usable Web
>
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogram
m
e
> >r-20
> >
> >--------------------------------------------------------------------
> >mail2web - Check your email from the web at
> >http://mail2web.com/ .
> >
> >
> >
> >
> >---
> >
> >Improve your web design skills with these new books from Glasshaus.
> >
> >Usable Web Menus
>
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogram
m
e
> >r-20
> >Constructing Accessible Web Sites
>
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogram
m
e
> >r-20
> >Practical JavaScript for the Usable Web
>
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogram
m
e
> >r-20
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |