• 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: Appending a list to a list and getting one list.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appending a list to a list and getting one list.


  • Subject: Re: Appending a list to a list and getting one list.
  • From: Arthur J Knapp <email@hidden>
  • Date: Tue, 14 May 2002 09:38:38 -0400

> Date: Mon, 13 May 2002 12:40:02 -0400
> Subject: Appending a list to a list and getting one list.
> From: Paul Skinner <email@hidden>

> set bigList to {}
> set bigListRef to a reference to bigList
> set numItems to 10000
> set t to (time of (current date)) --Start timing operations.
> repeat with n from 1 to numItems
> set bigListRef to bigListRef & n --SuperSlowDowner!

It sure is a super-slow-downer, primarily because after the first
iteration, bigListRef is no longer a reference, but the actual value
of "bigListRef & n".

You want to do any of the following:

set contents of bigListRef to bigListRef & n --> dereference

set bigList to bigListRef & n --> this does not affect the reference

set bigListRef's end to n --> append


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
<mailto:email@hidden>
(*) Happy
( ) Sad
( ) Ambivalent
( ) Ubiquitous
}
_______________________________________________
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.

  • Follow-Ups:
    • Re: Appending a list to a list and getting one list.
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: Parents/Child Scripts
  • Next by Date: Re: Briskets (perl)
  • Previous by thread: Re: Appending a list to a list and getting one list.
  • Next by thread: Re: Appending a list to a list and getting one list.
  • Index(es):
    • Date
    • Thread