Week number

Michael D Mays michael at GreppyDreppies.com
Mon Apr 15 10:21:01 EDT 2002


yves COPPE of yvescoppe at skynet.be wrote the following on 4/15/02 6:52 AM

> when you ask what date and answer : 15/04/2002 : the script cannot run to end.
> 
> what to do ??
My bet is your system date format is not set to DD/MM/YYYY or Revolution
wants the date to be "MM/DD/YYYY. If your system date format is set to
DD/MM/YYYY then you will need to write a function which populates the
dateitems. EG if the date is 15/4/2002 then substitute these lines for the
first convert statement:
on mouseUp
 ask "What date?"
 put the itemDelimiter into oldID
 set the itemDelimiter to "/"
 put item 3 of it into theYear
 put item 2 of it into theMonth
 put item1 of it into theDay
 set the itemDelimiter to oldID
 get theYear&","&theMonth&","&theDay
 put it into yearStart
 put "1,1" into item 2 to 3 of yearStart
 convert yearStart to dateItems
 put (item 7 yearStart-1)* 86400 into dayDif
 convert yearStart to seconds
 convert it to seconds
 answer "Week"&&(it-yearStart+dayDif)/86400  div 7 +1&&"of the year."
end mouseUp

michael




More information about the use-livecode mailing list