Re: Why save text item delimiters? Philosophical question....
Re: Why save text item delimiters? Philosophical question....
- Subject: Re: Why save text item delimiters? Philosophical question....
- From: Paul Skinner <email@hidden>
- Date: Wed, 18 Jun 2003 22:42:07 -0400
On Wednesday, June 18, 2003, at 03:28 PM, John Delacour wrote:
At 2:54 pm -0400 18/6/03, Andrew wrote:
On 6/18/03 10:58 AM, "David Crowe" <email@hidden>
wrote:
The real flaw, I think, is that the "text item delimiters" are
essentially a global variable.
Indeed. Given that one of the first rules of scalable programming is
to
avoid the usage of global variables it's somewhat baffling that the
designers of apple script choose to do it this way.
"Applescript's" text item delimiters is/are "global" within the
current script or application. If I run an applet to change text item
delimiters to space, it will not affect the text item delimiters in
force in any other application. The appellation "Applescript's text
item delimiters" is therefore doubly a misnomer, since a) it suggests
that it's a more global preference than it is and b) it suggests there
can be more than one of it/them. It's worth reminding people of this.
JD
There can be. But other TIDs won't do useful work.
set AppleScript's text item delimiters to {""}
script bob
property text item delimiters : {""}
end script
set bob's text item delimiters to {"x"}
bob's text item delimiters -->{"x"}
tell bob
text items of "abcxyz" -->{"a", "b", "c", "x", "y", "z"}
end tell
AppleScript's text item delimiters -->{""}
_______________________________________________
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.