Month arithmetic addendum
Month arithmetic addendum
- Subject: Month arithmetic addendum
- From: Michelle Steiner <email@hidden>
- Date: Tue, 28 Sep 2004 14:13:39 -0700
set the_months to {January, February, March, April, May, June, July, ¬
August, September, October, November, December}
display dialog "Enter the number of months to add." default answer ""
set n to (the text returned of the result) as integer
if (October as number) + n is greater than 12 then set n to n + 1
-- add error checking to ensure only integers are entered
item (((October as number) + n) mod 13) of the_months
It doesn't work with negative arithmetic if you go into the previous
year, but that shouldn't be too hard to solve; I'm too lazy right now,
though.
-- Michelle
--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden