Re: Faster List Checking
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.