Re: TIDs store and restore WAS Re: AsciiNumber & AsciiCharacter
Re: TIDs store and restore WAS Re: AsciiNumber & AsciiCharacter
- Subject: Re: TIDs store and restore WAS Re: AsciiNumber & AsciiCharacter
- From: Nigel Garvey <email@hidden>
- Date: Sun, 2 Jun 2002 18:09:15 +0100
Paul Skinner wrote on Fri, 31 May 2002 17:04:22 -0400:
>
While working on rewriting some handlers I looked into the whole
>
storing and restoring of the TIDs. I don't know that this technique is
>
novel, but it is concise, quick and creates no new variables.
>
This method exploits a bug in the TIDs that causes them to only use
>
the first item if the TIDs is a list. If this is ever fixed then this
>
technique will be broken.
>
>
>
. Store and change the TIDs...
>
set AppleScript's text item delimiters to {newDelimiter, item 1 of
>
(AppleScript's text item delimiters as list)}
>
>
Restore the TIDs...
>
set AppleScript's text item delimiters to {item 2 of AppleScript's text
>
item delimiters}
>
>
>
This method reminds me of Nigel's comment...
>
> (Another idea I had - to set the 'beginning' of the delimiters to the
>
> new value and then to reset them to their 'rest' afterwards - was
>
> roundly (and rightly) sat upon by senior contributors to this group. ;-)
>
> )
>
Hopefully I will not be similarly sat upon, but if anyone sees an
>
issue I'm sure they'll let it be known.
Unfortunately, the reason my idea was sat upon was precisely because
multiple TIDs might be implemented at some point in the future, thus
causing the downfall of any civilisation that depended on their
non-implementation. :-(
With AppleScript, there's no guarantee that *anything* will work the same
way in the future - even if it's legally scripted now. But there's
probably no point in taking a risk in this particular case, given that
there are simple, non-controversial alternatives.
That's not to say that you shouldn't experiment if you feel like it. ;-)
NG
_______________________________________________
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.