• 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: problem w/ text item delimiters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem w/ text item delimiters


  • Subject: Re: problem w/ text item delimiters
  • From: T&B <email@hidden>
  • Date: Tue, 6 Feb 2007 12:05:33 +1100

a) you want a list

so i can use that nifty text item delimiters trick to avoid having to put newlines everywhere;-)

Using a list to build sections of a string also has a memory management and speed advantage, I believe.
If you say:


set a to "long string"
set a to a & "another long string"
set a to a & "more long strings, many times"
etc

then AppleScript has to allocate the memory each time for the result of a & newstring, then deallocate the old memory for a, then swap/ append etc.

But if done this way:

set a to {"long string"}
set end in a to "another long string"
set end in a to "more long strings, many times"
etc
set a to a as string

then AppleScript doesn't have to reallocate memory and append strings with each and every append. It only does it once, when converting to a string.

I'm sure Matt and others could explain this more accurately ;-)

Tom

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: problem w/ text item delimiters (From: tom wible <email@hidden>)

  • Prev by Date: without case sensitive
  • Next by Date: Re: problem w/ text item delimiters
  • Previous by thread: Re: problem w/ text item delimiters
  • Next by thread: Re: problem w/ text item delimiters
  • Index(es):
    • Date
    • Thread