Re: Appending a list to a list and getting one list.
Re: Appending a list to a list and getting one list.
- Subject: Re: Appending a list to a list and getting one list.
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 May 2002 11:55:25 -0700
On 5/14/02 11:24 AM, "Paul Skinner" <email@hidden> wrote:
>
> set bigListRef's end to n --> append
>
>
I'd love to do this but it gives me a list of lists when n is a list.
>
That and the speed of concatenation was the impetus for my post.
If you're adding a large list to your very big list, once or twice, then
concatenating is the way to go.
If you're adding short lists, frequently (say, in a repeat loop) to your big
list, then do a repeat loop to append each item of the short list to the end
of the bigListRef. That's much faster. Even with medium size lists (and
perhaps even large lists), that might be faster if you make +_both_ lists
references:
set bigListRef to a reference to bigList
set secondListRef to a reference to secondList
repeat with i from 1 to (count secondList )
set newItem to item i of secondListRef
set end of bigListRef to newItem
end repeat
That just might be faster than
set bigList to bigList & secondList
under some circumstances, although I'm doubtful.
--
Paul Berkowitz
_______________________________________________
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.