Post by Tim^^BOBI'm confused here. I went to your webpage and looked at the calender,
but I don't understan how that is supposed to teach me. I can't see
any source code at all, and isn't that just an ActiveX control? I
think I must also be wrong here, but are you saying ASP is just a html
page with VBScipt and a ".asp" extension?
Thanks to all repliers
You don't see source code on an ASP page because it's processed **at the
server** to produce the HTML that displays the desired info. The difference
between VBScript and an ActiveX control is that ActiveX controls must be
installed on the server by an admin person. ASP scripts are simply uploaded
like regular HTML pages.
If it doesn't get munged too badly in transit, the code for the calendar page is
below:
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<% response.buffer = true %>
<HTML>
<HEAD>
<TITLE>
Calendar - Week 1 - Page 200-
</TITLE>
</HEAD>
<BODY>
<%
function GetMonthName(iMonth)
select case iMonth
case 1:
GetMonthName = "January"
case 2:
GetMonthName = "February"
case 3:
GetMonthName = "March"
case 4:
GetMonthName = "April"
case 5:
GetMonthName = "May"
case 6:
GetMonthName = "June"
case 7:
GetMonthName = "July"
case 8:
GetMonthName = "August"
case 9:
GetMonthName = "September"
case 10:
GetMonthName = "October"
case 11:
GetMonthName = "November"
case 12:
GetMonthName = "December"
case else:
GetMonthName = "Invalid Month"
end select
end function
dim dtCurrentDate, strMonth, aryCalDays(42), iFirstDay, iDaysinMonth, iLoop
dim iRows, iColumns, iRowsLoop, iColumnsLoop
dim iMonth, iDay, iTemp
dtCurrentDate = date()
iDay=day(dtCurrentDate)
if request.querystring <> "" then
iMonth = Cint(request.querystring)
else
iMonth = month(dtCurrentDate)
end if
iFirstDay = datepart("w", dateserial(Year(dtCurrentDate), iMonth,1)) ' day 1
of month
iDaysinMonth = datepart("d", dateserial(year(dtCurrentDate), iMonth +1, 1 -1))
' last day of current month
strMonth = GetMonthName(iMonth)
if left(strMonth,3) = "Inv" then
response.write "<BR><H1>Argument Error: " & strMonth & "</H1><BR>"
response.write "</BODY></HTML>"
response.end
end if
iRows = 6 - int((42 - (iFirstDay + iDaysinMonth)) / 7) 'rows needed on
calendar
for iLoop = 1 to iDaysinMonth
aryCalDays(iLoop + iFirstDay -1) = iLoop
next
iColumns = 7
%>
<TABLE ALIGN="CENTER" BORDER="1" CELLSPACING="1" WIDTH="75%" HEIGHT="75%">
<TH COLSPAN=7>
<FONT SIZE=+2>
<%=strMonth & ", " & year(dtCurrentDate) %>
</FONT>
</TH>
<%
'loop thru rows and columns
for iRowsLoop = 1 to iRows
'new row
response.write "<TR>"
for iColumnsLoop = 1 to iColumns
'new column, display day, black out empty
if aryCalDays((iRowsLoop -1)*7 + iColumnsLoop) > 0 then
'show date
iTemp = (iRowsLoop-1)*7 + iColumnsLoop
if cint(aryCalDays(iTemp)) = iDay then
response.write "<TD bgcolor=yellow VALIGN=TOP
ALIGN=RIGHT WIDTH=""14%"">"
else
response.write "<TD VALIGN=TOP ALIGN=RIGHT WIDTH=""14%"">"
end if
response.write aryCalDays(iTemp)
'response.write "<br> " & iTemp & " " & iDay
response.write "</TD>"
else
'black out
response.write "<TD BGCOLOR=GRAY> </TD>"
end if
next
'close row
response.write "</TR>"
next
%>
</TABLE>
<A HREF="default.asp">Home Page</A>
</BODY>
</HTML>
More about me: http://www.jecarter.com/
VB3/VB6/C/PowerBasic source code: http://www.jecarter.com/programs.html
Freeware for the Palm with NS Basic source code: http://nsb.jecarter.com
Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
johnecarter ***@at mindspring dot.dot com. Fix the obvious to reply by email.