Week number

yves COPPE yvescoppe at skynet.be
Mon Apr 15 12:35: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
>




In fact I see with the debugger I have another problem :

when i creta a btn with

on mouseUp
put "2002,04,15"  into tmp
convert tmp to dateitems
answer tmp # gives : "2002,04,15"
convert tmp to seconds
answer tmp # gives : "2002,04,15"
end mouseUp

So your code doesn't work.

i always stay with "2002,04,15" without any conversion.

So it is  not a problem of date format (DD/MM/YYYY or MM/DD/YYYY)
but the convert command doesn't work correctly for me.
It must be a bug because your code works fine in hypercard !!
-- 
Greetings.

Yves COPPE

Email : yvescoppe at skynet.be



More information about the use-livecode mailing list