home *** CD-ROM | disk | FTP | other *** search
- on calcMonth n
- global dayList, monthList, thisMonth, firstDayOfMonthList, dayOfWeek, firstDay
- set x to getPos(monthList, thisMonth) + 1
- set i to x / 2
- set numberOfDays to getAt(monthList, x)
- set start to getAt(firstDayOfMonthList, i)
- set firstDay to start
- set dayOfWeek to getAt(dayList, start)
- set day to 1
- repeat with i = 1 to 6
- repeat with x = start to 7
- set dayOfWeek to getAt(dayList, x)
- put string(day) into line i of field dayOfWeek
- set day to day + 1
- if day > numberOfDays then
- exit repeat
- end if
- end repeat
- if day > numberOfDays then
- exit repeat
- end if
- set start to 1
- end repeat
- end
-