Re: Month as Integer
Re: Month as Integer
- Subject: Re: Month as Integer
- From: Michelle Steiner <email@hidden>
- Date: Wed, 29 Nov 2000 15:10:24 -0800
On 11/29/00 10:41 AM, Pier Kuipers <email@hidden> wrote
>
Here's what I use to get the month's number:
>
>
on GetMonthNumber()
>
set theMonth to month of (current date)
>
set theMonthList to {January, February, March, April, May, June,
>
July, August, September,
>
October, November, December}
>
set x to 1
>
repeat with i from 1 to 12
>
if (item x of theMonthList) is (theMonth) then
>
set y to x
>
exit repeat
>
else
>
set x to x + 1
>
end if
>
end repeat
>
set theMonthNumber to x
>
end GetMonthNumber
Why not this:
on GetMonthNumber()
set theMonth to month of (current date)
set theMonthList to {January, February, March, April, May, June, ,
July, August, September, ,
October, November, December}
repeat with i from 1 to 12
if (item i of theMonthList) is (theMonth) then return i
end repeat
end GetMonthNumber
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------