Re: Maxing out a list
Re: Maxing out a list
- Subject: Re: Maxing out a list
- From: email@hidden (Michael Sullivan)
- Date: Mon, 8 Apr 2002 11:03:22 -0400
- Organization: Society for the Incurably Pompous
christian vick <email@hidden> writes:
>
Doug Adams writes:
>
> What is the maximum number of items that can be stored in a list before a
>
> -20013 error is invoked? Is it based on the number of items or on total
>
> characters of all the items?
>
About 4300 items is the max, no matter what an actual list item represents
>
(so no total character length limit).
This gets discussed here every so often, and this statement is not quite
correct.
That's the max that can be packed into a list (or returned as a list) in
one operation, but one can build lists that are far larger than that.
--example:
set theString to ""
repeat 5000 times
set theString to theString & "a"
end repeat
set theList to every text item of theString
--> stack overflow Err -2706
--or:
repeat 5000 times
copy "a" to end of theList
end repeat
set anotherList to every item of theList
--> stack overflow Err -2706
--but:
set theList to {}
repeat 5000 times -- you could do 5000000 here if you have enough memory
copy "a" to end of theList
end repeat
return theList
--> no error.
Also the error you get at the 4??? items problem is a stack overflow,
which is -2706.
AFAIK, lists are limited in size only by available memory.
As Emmanuel mentioned, I'd like to see the code generating that error,
because it's not a system OOM error, and not an applescript suite error
number either, so it's probably some application that's giving it.
My guess is that whatever application Doug is trying to script has a
limit on the size of list it will interpret in a scripting call.
Michael
--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT 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.