Forums
This topic is locked
Help with thismonth
21 Jul 2006 21:29:20 the bigo posted:
I have the following code:<pre id=code><font face=courier size=2 id=code>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<%
Dim thisdate
thisdate = Now()
thismonth = Month(thisdate)
thisYear = Year(thisdate)
range = 12 - thismonth
reqoffset = Request.QueryString("offset"
If (reqoffset = "" Then
offset = 0
ElseIf (reqoffset > range) Then
offset = (reqoffset - range)
MonPlus1 = offset
hisyear = (thisyear + 1)
Else
offset = reqoffset
MonPlus1 = (thismonth + offset)
End If
%>
This date : <%=thisdate%><br />
This month : <%=thismonth%><br />
This year : <%=thisyear%><br />
Months until December [RANGE] : <%=range%><br />
Requested Offset : <%=reqoffset%><br />
Offset : <%=offset%><br />
Monthplus1 : <%=MonPlus1%><br />
<%=MonthName(MonPlus1)%> <%=thisYear%>
</body>
</html>
</font id=code></pre id=code>
The idea is that I can present events for a certain month. Then create tabs for the next 11 months dependant on what this month is...i.e. July 2006 to June 2007.
The above works where the offset in the url is testpage.asp?offset=6
as 6 is greater than '>' the months until christmas. But anything lower and it just seems to IGNORE my '>' clause in the Elseif statement.
I am not great at ASp, so if someone could point me in the right direction or correct the code syntax, I would apreciate it.