• 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: Removing characters from a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing characters from a string


  • Subject: Re: Removing characters from a string
  • From: Kai Edwards <email@hidden>
  • Date: Wed, 06 Nov 2002 02:32:29 -0800

on Tue, 05 Nov 2002 00:15:25 -0800, Paul Berkowitz <email@hidden>
wrote:

>> The method checks each character of the name individually, lists the
>> characters that pass the comparison test, and finally coerces the list to a
>> string (truncating to 32 characters as necessary). Since it works quite
>> happily without setting any TIDs, there's no need (IMO) to store or restore
>> them. (It may not be as fast as using TIDs - but that's another issue.)
>
> Ooops.
>
> "finally coerces the list to a string", which it does by inserting the
> current text item delimiters, whatever they may be, between each list item
> when turning it into a string. That's precisely what tids DO.

Thanks Paul - I do realise that. My point (perhaps not that clearly made)
was that if a script doesn't change TIDs, then it really shouldn't (IMO) be
necessary to store or restore them.

> So if he doesn't set them as he wants them - whether it was {", "}, {" "},
> {""}, {return} or whatever, you just might end up with ":" between each list
> item. or maybe "gopher" or "http" or "A very long sentence used as a
> marker." Of course he has to set tids to {""} if he's trying to turn a list
> of characters into a string with no interlopers.

Most of the examples posted around here involving simple list-to-string
coercions don't take that precaution. On the other hand, those that actually
change TIDs generally do.

I believe the point you're making (that the current status of TIDs within a
script influences the outcome of any list-to-string coercions) is a
pertinent one - especially with more complex scripts that actively use TIDs.

However, I still can't help thinking that storing, setting and restoring
TIDs is a largely unnecessary complication for a simple script that doesn't
need to _change_ TIDs, but which simply coerces a list to a string somewhere
along the line.

Kai

--
email@hidden
email@hidden
_______________________________________________
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.

  • Prev by Date: Re: Tid's 'n AS
  • Next by Date: Re: Tid's 'n AS
  • Previous by thread: Re: Removing characters from a string
  • Next by thread: Play sound in Jaguar?
  • Index(es):
    • Date
    • Thread