home *** CD-ROM | disk | FTP | other *** search
/ The Weather Channel - Everything Weather / TheWeatherChannel-EverythingWeather-Win31.iso / twcia / calndr1 / calndrx.dxr / 00029.ls < prev    next >
Encoding:
Text File  |  1995-08-25  |  676 b   |  25 lines

  1. on calcMonth n
  2.   global dayList, monthList, thisMonth, firstDayOfMonthList, dayOfWeek, firstDay
  3.   set x to getPos(monthList, thisMonth) + 1
  4.   set i to x / 2
  5.   set numberOfDays to getAt(monthList, x)
  6.   set start to getAt(firstDayOfMonthList, i)
  7.   set firstDay to start
  8.   set dayOfWeek to getAt(dayList, start)
  9.   set day to 1
  10.   repeat with i = 1 to 6
  11.     repeat with x = start to 7
  12.       set dayOfWeek to getAt(dayList, x)
  13.       put string(day) into line i of field dayOfWeek
  14.       set day to day + 1
  15.       if day > numberOfDays then
  16.         exit repeat
  17.       end if
  18.     end repeat
  19.     if day > numberOfDays then
  20.       exit repeat
  21.     end if
  22.     set start to 1
  23.   end repeat
  24. end
  25.