• 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: Faster List Checking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster List Checking


  • Subject: Re: Faster List Checking
  • From: John Stewart <email@hidden>
  • Date: Thu, 29 May 2003 05:22:35 -0400

On Wednesday, May 28, 2003, at 06:39 PM, Steven Angier wrote:

Actually you have it backwards, AppleScript's text item delimiters are in fact a list. The catch is they currently ignore anything other than the first item. AppleScript is smart enough to silently coerce "" to {""} when you use your example, not the other way round. :)

Try this in your script editor sometime -

return AppleScript's text item delimiters

--> {""}

That is the default, but try this

set applescript's text item delimiters to ""
return applescript's text item delimiters
--> ""

Setting text item delimiters to a string has two advantages over setting them to a single item list:
1. its faster (around 5-10%)
2. you will never leak away all your memory under Mac OS 9


That's true, it is the default and you can set it to just about anything you want. You can do the same with AppleScript's other constants too. Most times this won't cause any confusion because the scripter that wrote the script knows it's been done but what happens when someone else tries to maintain the script? I prefer to keep things as close to their default values as possible. Tids are just that, a constant that gets changed (sometimes often).

set pi to "apple"
return pi
--> "apple"

set days to weeks
return days
--> 604800

Setting text item delimiters to a string has two advantages over setting them to a single item list:
1. I haven't tested this so I won't comment on it.
2. What about Mac OS X? Mac OS 9 is a dead horse and predicating a script on it seems a bit limited.

John
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Faster List Checking
      • From: Malcolm Fitzgerald <email@hidden>
    • Re: Faster List Checking
      • From: Gary Lists <email@hidden>
References: 
 >Re: Faster List Checking (From: Steven Angier <email@hidden>)

  • Prev by Date: Saving an email with mail
  • Next by Date: Re: applescripted login
  • Previous by thread: Re: Faster List Checking
  • Next by thread: Re: Faster List Checking
  • Index(es):
    • Date
    • Thread