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: Jon Pugh <email@hidden>
- Date: Mon, 16 Jun 2003 21:00:15 -0700
At 10:03 AM -0400 6/16/03, Paul Skinner wrote:
>
While there has been great debate in the past as to the value of this store/reset practice. It comes down to this simple fact...
>
>
There are cases where not restoring them will cause problems in your code. There are NO cases where storing/restoring will cause problems in your code.
>
>
If you store and restore the TIDs nothing bad will come of it. If you don't store and restore them then USUALLY nothing bad will come of it, given proper diligence to set immediately before using them. There are cases, however, where you cannot set the TIDs immediately before you use them.
>
You need examples?
Don't forget the popular implicit string coercion which uses the text item delimiters, that's the one that always bites people who forget to set them back.
set text item delimiters to space
set moof to "m o o f"
set foom to reverse of text items of moof
set foom1 to foom as string
set text item delimiters to {}
{foom, foom1, foom as string}
Jon
_______________________________________________
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.