• 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
Re: Best practices- nested loops or handlers or both
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practices- nested loops or handlers or both


  • Subject: Re: Best practices- nested loops or handlers or both
  • From: kai <email@hidden>
  • Date: Tue, 2 Nov 2004 04:37:45 +0000


On Mon, 01 Nov 2004 20:44:32 -0600, Dave Balderstone wrote:

On Nov 1, 2004, at 8:34 PM, David Andrews wrote:

Your logic will not work for "Sunday"

Missed that, good catch.

Revision:

on isweekend(d)
	if ((weekday of d) as string) contains "Saturday" or ((weekday of d)
as string) contains "Sunday" then
		return true
	else
		return false
	end if
end isweekend


Or simply:

------------------------------------

d's weekday is in {Saturday, Sunday}

------------------------------------

Of course, once a handler boils down to a single line, it might be cleaner to insert it directly in the original calling code...

---
kai

_______________________________________________
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


  • Prev by Date: Re: Bridge anyone? [not off topic]
  • Next by Date: Re: Bridge anyone? [not off topic]
  • Previous by thread: Re: Best practices- nested loops or handlers or both
  • Next by thread: Re: Inheritance and Loaded Libraries
  • Index(es):
    • Date
    • Thread