Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there a limit on the size of an array?

Guest
Mar 19, 2012 Mar 19, 2012

I have two arrays: array1 and array2.

I have a function that is iterating through array1. If an item in the array matches a particular condition, then that item is pushed onto array2. I can successfully push up to 19 items onto array2. However, if I attempt to push any additional item on top of the 19 items already in the array, then that push fails. Can I not have more than 19 items in an array? Is there any way to increase the size of the array?

TOPICS
Scripting
805
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 20, 2012 Mar 20, 2012

If you are seeing only 20 array elements in the Data Browser it does not mean that the array is limited to 20 elements*. You are perhaps seeing a display restriction in the data browser. Have you checked the actual number of elements in your final array by testing its length property?

You can change the number of elements displayed in the Data Browser in the ExtendScript Toolkit Preferences on the Debugging page.

*Note that there are 20 items shown as the first one has an idex of 0.

Ian

Translate
Enthusiast ,
Mar 20, 2012 Mar 20, 2012

If you are seeing only 20 array elements in the Data Browser it does not mean that the array is limited to 20 elements*. You are perhaps seeing a display restriction in the data browser. Have you checked the actual number of elements in your final array by testing its length property?

You can change the number of elements displayed in the Data Browser in the ExtendScript Toolkit Preferences on the Debugging page.

*Note that there are 20 items shown as the first one has an idex of 0.

Ian

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 20, 2012 Mar 20, 2012
LATEST

[headdesk] I feel silly. Yep, you got it. I was tearing my hair out over this. Thanks for the tip. I wonder why the limit is so low. Is parsing an array greater than 20 elements in the data browser really consuming that many resources?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines