A strange bug (?) with calendar (from the Scripter's Scrapbook)

Dom mcdomi at free.fr
Mon Mar 8 08:59:22 EST 2004


As an exercise, I tested the script given in the Scripter's Scrapbook:

=====
on mouseUp
  put calendar(Apr,1995) into cd fld "Calendar"
end mouseUp

function calendar month,year
  put "Sun Mon Tue Wed Thu Fri Sat" into dayHeader
  get (month & " 1, " & year)
  convert it to long date
  put it into currentDate
  delete word 1 of it
  delete word 2 of it
  repeat with i = 1 to (length(dayHeader)-length(it)) div 2
    put " " before it
  end repeat
  put it into monthHeader
  convert currentDate to dateItems
  put item 2 of currentDate into monthNum
  put empty into days
  repeat with dayNum = 1 to (item 7 of currentDate) - 1
    put "    " after days
  end repeat
  repeat while item 2 of currentDate is monthNum
    get " " & item 3 of currentDate & " "
    if length(it) is 3 then get " " & it
    if item 7 of currentDate is 7 then get it & return
    put it after days
    add 1 to item 3 of currentDate
    convert currentDate to seconds -- to force next line to reconvert
    convert currentDate to dateItems
  end repeat
  return monthHeader & return & dayHeader & return & days & return
end calendar
====

I tested also all the months, not only April ;-)
and I encountered a very strange bug (?):
in some months, the day 22 is not written in the "calendar" field!
This seems to be systematic, only in months from April to October!

Can you verify on your machine?
Here Mac OS 10.2.4 / RR 2.1.2
-- 
Vous parlez français ? faites un tour sur le groupe francophone !
revolutionfr-subscribe at yahoogroupes.fr
Jetez un oeil sur RevoBlog <http://revoblog.free.fr> !


More information about the use-livecode mailing list