home *** CD-ROM | disk | FTP | other *** search
- global Ydays, Febs, Mdays, Totyears, monthtext, datetext
- global baseday, theyear, themonth, theday, thedate
- global keydates, cdvar
-
- on setupdummydates
- set keydates = []
- repeat with j = 1 to 2557
- setat keydates,j,j
- end repeat
- end setupdummydates
-
- on setupdatevars
- set Totyears = 7
- set baseday = 3 -- wednesday (1,1,92)
- set Ydays = [366,365,365,365,366,365,365]
- set Febs = [29,28,28,28,29,28,28]
- set Mdays =[31,0,31,30,31,30,31,31,30,31,30,31]
- set monthtext = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
- set datetext = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
- end setupdatevars
-
- on finddate offset
- if offset<1 then return (" ")
- set tmpnumber = offset
- --ï find year ï
- set yearoffset = 0
- repeat with j = 1 to Totyears
- set target = getat(Ydays,j)
- if tmpnumber>target then
- set yearoffset = yearoffset+1
- set tmpnumber = tmpnumber-target
- else
- set theyear = 92+yearoffset
- exit repeat
- end if
- end repeat
- --ï find month ï
- set monthoffset = 0
- repeat with j = 1 to 12
- set target = getat(Mdays,j)
- if target = 0 then
- set target = getat(Febs,yearoffset+1)
- end if
- if tmpnumber>target then
- set monthoffset = monthoffset+1
- set tmpnumber = tmpnumber-target
- else
- set themonth = 1+monthoffset
- exit repeat
- end if
- end repeat
- set thedate = tmpnumber
- case thedate of
- 1,21,31: set tmpth = "st"
- 2,22: set tmpth = "nd"
- 3,23: set tmpth = "rd"
- otherwise set tmpth = "th"
- end case
- set theday = ((offset+1) mod 7)+1
- set tmpstring = getat(datetext,theday)&&string(thedate)&tmpth
- set tmpstring = tmpstring&& getat(monthtext,themonth)&& string(theyear)
- return tmpstring
- end finddate
-
- on checkcontrol
- if the controldown then
- if cdvar = 0 then
- set cdvar = 1
- redisplaydates
- end if
- else
- if cdvar = 1 then
- set cdvar = 0
- redisplaydates
- end if
- end if
- end checkcontrol
-
-
-
-