"McKirahan" <> wrote in message
news:w7KdndLOdOgmInvcRVn-...
> ".:mmac:." <lost@sea> wrote in message
> news:#JFhvSZ#...
> > I have to update a page every week. I get the page ahead of time so I
used
> > the "scheduled includes" webbot in Frontpage only to find that I would
> have
> > to refresh the page every week to have it work. That is silly, it should
> run
> > by itself. so...
> > I asked the question in the FP group and I was offered this
pseudocode
> > to do it by month which would work if it's possible to do it by week
> without
> > writing 52 seperate lines, one for each week which would change each
year
> > and have to be rewritten each year.
> >
> > <% If Now()>date("1/3/2005") then %>
> > <!-- #include file="includes/mar.asp" -->
> > <% elseif Now()>date("1/2/2005") then %>
> > <!-- #include file="includes/feb.asp" -->
> > <% else %>
> > <!-- #include file="includes/jan.asp" -->
> > <% endif %>
> >
> > Now the goal for me would be something that would calculate which week
of
> > the year (any year) it is.
> > i.e. Jan 1-7 = w1.htm , Jan 8-15= w2.htm etc. and return a Wx.htm for
> each
> > week.
> > That way all I have to do is save a wx.htm file where x= week of year.
> > so ... how can I caclulate what week of the year it is?
>
>
> Will January 1 - 7 always be Week 1?
>
> Will Week 53 always consist of just one or two days?
This will generate an "include file" statement.
<%
Dim incl
incl = "<!--#include file=" & Chr(34) & "w##.htm" & Chr(34) & "-->"
Dim week
week = Replace(incl,"##",Int((DatePart("y",Date())+6)/7))
Response.Write week & vbCrLf
%>
However, AFAIK, you can't generate an "include file" from within ASP then
have it do its thing.
"... server side include files are inserted into their holding file before
any of the holding file is ... processed by ASP..." --
http://www.codefixer.com/tutorials/dynamic_includes.asp