PDA

View Full Version : change month code to year


gcapp
09-19-2002, 03:07 PM
I need to see if I can change the code at the bottom of this note. Right now it displays a photo for each day of the month. However, I wanted to know how to change the code for a whole year? Can this code be changed or is there another code I can use for displaying one picture per day for 365 days?

If anyone knows the code I would appreciate it.

Gary




Code:
<%
'build your array
Dim TEnd(31)
TEnd(0)="http://www.enchantedmountains.info/images/daily-photo/summer/allegany-river-130.jpg"
TEnd(1)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_canoeing-130.jpg"
TEnd(2)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_water_canoe-130.jpg"
TEnd(3)="http://www.enchantedmountains.info/images/daily-photo/summer/county_fair-130.jpg"
TEnd(4)="http://www.enchantedmountains.info/images/daily-photo/summer/dancing_lady-130.jpg"
TEnd(5)="http://www.enchantedmountains.info/images/daily-photo/summer/fallingleavesfest-130.jpg"
TEnd(6)="http://www.enchantedmountains.info/images/daily-photo/summer/flat_man-130.jpg"
TEnd(7)="http://www.enchantedmountains.info/images/daily-photo/summer/allegany-river-130.jpg"
TEnd(8)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_canoeing-130.jpg"
TEnd(9)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_water_canoe-130.jpg"
TEnd(10)="http://www.enchantedmountains.info/images/daily-photo/summer/county_fair-130.jpg"
TEnd(11)="http://www.enchantedmountains.info/images/daily-photo/summer/dancing_lady-130.jpg"
TEnd(12)="http://www.enchantedmountains.info/images/daily-photo/summer/fallingleavesfest-130.jpg"
TEnd(13)="http://www.enchantedmountains.info/images/daily-photo/summer/allegany-river-130.jpg"
TEnd(14)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_canoeing-130.jpg"
TEnd(15)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_water_canoe-130.jpg"
TEnd(16)="http://www.enchantedmountains.info/images/daily-photo/summer/county_fair-130.jpg"
TEnd(17)="http://www.enchantedmountains.info/images/daily-photo/summer/dancing_lady-130.jpg"
TEnd(18)="http://www.enchantedmountains.info/images/daily-photo/summer/fallingleavesfest-130.jpg"
TEnd(19)="http://www.enchantedmountains.info/images/daily-photo/summer/flat_man-130.jpg"
TEnd(20)="http://www.enchantedmountains.info/images/daily-photo/summer/allegany-river-130.jpg"
TEnd(21)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_canoeing-130.jpg"
TEnd(22)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_water_canoe-130.jpg"
TEnd(23)="http://www.enchantedmountains.info/images/daily-photo/summer/county_fair-130.jpg"
TEnd(24)="http://www.enchantedmountains.info/images/daily-photo/summer/dancing_lady-130.jpg"
TEnd(25)="http://www.enchantedmountains.info/images/daily-photo/summer/fallingleavesfest-130.jpg"
TEnd(26)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_canoeing-130.jpg"
TEnd(27)="http://www.enchantedmountains.info/images/daily-photo/summer/asp_water_canoe-130.jpg"
TEnd(28)="http://www.enchantedmountains.info/images/daily-photo/summer/county_fair-130.jpg"
TEnd(29)="http://www.enchantedmountains.info/images/daily-photo/summer/dancing_lady-130.jpg"
TEnd(30)="http://www.enchantedmountains.info/images/daily-photo/summer/fallingleavesfest-130.jpg"
%>

whammy
09-19-2002, 04:05 PM
That is very easy to do... however all you included was an array of the 30 picture names.

If you just had pictures named from 1.jpg to 365.jpg (or an array of pictures like you show above) you could do this to get the day of the year (not thoroughly tested):

<%
Dim Jan1, Today, ThisYear, NoOfDays

ThisYear = Year(Now)
Jan1 = "1/1/" & ThisYear
Today = Date()

NoOfDays = DateDiff("d",Jan1,Today)+1
Response.Write(NoOfDays)
%>