• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Month arithmetic addendum
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Month arithmetic addendum
      • From: Martin Orpen <email@hidden>
  • Prev by Date: Sv: dropping folders
  • Next by Date: igPay atinLay, second pass
  • Previous by thread: Re: AppleScript causing FMP XML output error?
  • Next by thread: Re: Month arithmetic addendum
  • Index(es):
    • Date
    • Thread