previous and next year is the current year?!?!?? P

# Thread: previous and next year is the current year?!?!?? P

1. Member
Join Date
Dec 1969
Posts
51

## previous and next year is the current year?!?!?? P

2. Senior Member
Join Date
Dec 1969
Posts
5,104

## Holy code dump, Batman!

Want to try just the relavent parts?<BR><BR>-Doug

3. Member
Join Date
Dec 1969
Posts
51

## RE: Holy code dump, Batman!

4. Senior Member
Join Date
Dec 1969
Posts
1,913

## Holy REPEATED code dump, Batman!

5. Senior Member
Join Date
Dec 1969
Posts
1,765

## Does anyone actually read all this

When I see code dumps....followed by a repeat code dump, I just skip to the next post! Not that I&#039;m trying to be rude, but by the time I read all that, I could have actually been productive here at work!

6. Member
Join Date
Dec 1969
Posts
51

## RE: Holy REPEATED code dump, Batman!

Maybe I can send it to you so you can look at it, with a little less code beceause it all has to be together otherwise it doesn&#039;t work, but here his the relevant code :<BR><BR>----------------------------------------------------------------<BR>&#039; To add or don&#039;t add a year<BR> If Request.Querystring("jaar") = "" Then <BR> JaarToAdd = Year(Date())<BR> Else <BR> JaarToAdd = Request.Querystring("jaar")<BR> End If <BR><BR>CurrentYear = JaarToAdd<BR><BR>Jaar = CurrentYear<BR><BR>----------------------------------------------------------------<BR>&#039; For the next week<BR>Function NextWeek(tCurrentWeek, tCurrentYear)<BR> Dim RetVal<BR> If CInt(tCurrentWeek) = CInt(WeeksInYear(tCurrentYear)) Then<BR> RetVal = "week=1&" & _<BR> "jaar=" & tCurrentYear + 1<BR> Else<BR> RetVal = "week=" & tCurrentWeek + 1 & "&" & _<BR> "jaar=" & tCurrentYear<BR> End if<BR> NextWeek = RetVal<BR>End Function<BR><BR>&#039; For the previous week<BR>Function PreviousWeek(tCurrentWeek, tCurrentYear)<BR> Dim RetVal<BR> If CInt(tCurrentWeek) = 1 Then<BR> RetVal = "week=" & WeeksInYear(tCurrentYear - 1) & "&" & _<BR> "jaar=" & tCurrentYear - 1<BR> Else<BR> RetVal = "week=" & tCurrentWeek - 1 & "&" & _<BR> "jaar=" & tCurrentYear<BR> End if<BR> PreviousWeek = RetVal<BR>End Function<BR><BR>----------------------------------------------------------------<BR>&#039; To write away the dates in a given week<BR>Call WriteDates (7)<BR><BR>Function WriteDates(ByVal WeekNumber) <BR> iRequestedWeek = CurrentWeek<BR> iCurrentWeek = DatePart("ww",Date())<BR> iJumpWeeks = iRequestedWeek - iCurrentWeek<BR> tCurrentYear = Request.Querystring("jaar")<BR> <BR> dtDate = DateAdd("ww",iJumpWeeks,FirstDayOfWeek(Date()))<BR > <BR> Response.Write dtDate & " - " & tCurrentYear <BR> <BR> For i = 0 to 6<BR> Dates = Dates + "&#060;tr&#062;" &_<BR> "&#060;td class=""lijn""&#062;" &_<BR> "<BR>&#060;a class=""txt2"" href=""agendaI_edit.asp?task=NEW&datum=" & dtDate + i & "&datumdb=" & dtDate + i & """&#062;" & dtDate + i & "&#060;/a&#062;" &_<BR> "&#060;/td&#062;" &_<BR> "&#060;td class=""lijn""&#062;&nbsp;&#060;/td&#062;" &_<BR> "&#060;td class=""lijn""&#062;&nbsp;&#060;/td&#062;" &_<BR> "&#060;td class=""lijn""&#062;&nbsp;&#060;/td&#062;" &_<BR> "&#060;td class=""lijn""&#062;&nbsp;&#060;/td&#062;" &_<BR> "&#060;td class=""lijn""&#062;&nbsp;&#060;/td&#062;" &_<BR> "&#060;/tr&#062;" <BR> <BR> Next<BR>End Function

7. Senior Member
Join Date
Dec 1969
Posts
5,104

## Productive at work?!

You monkey spanker!

8. Member
Join Date
Dec 1969
Posts
51

.....Could I send it to you so that you can look at it? I&#039;ve maked a shortet version of it! I allready put a shorter version of the code here.(it&#039;s the relevant version) But please help me, it have to be finished today.<BR><BR>Thanx

9. Senior Member
Join Date
Dec 1969
Posts
5,104

## Put in some debugging code.

Put in Response.Write&#039;s to find out what the dates are before you pass it to functions and after you get it back from functions.<BR><BR>Then, view the source to find out what dates you are passing for the links.<BR><BR>You should be able to narrow down the problem to a specific function or them method you are using to add when you pass it in a link.<BR><BR>-Doug

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•