This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 25, 2011, 8:00 PM
64 Posts

It looks to me like it's working correctly...

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 4
- The statement
 
var a = new Array(new Array(4), new Array(4));

is creating a Java array with two elements, one a Java array with 4 elements, and the other a Java Array with 4 elements.  Those two should have indexes 0 and 1, so when you reach 2, it fails, exactly like it's supposed to.  Since it's Java, and not JS, it won't automagically tack on new elements for you.
 
- I would look up how Java does multi-dimensional arrays and use that.  ArrayList of ArrayList comes to mind, for a fully dynamic jagged array that would work for smaller amounts of data.

Hope this helps...
Apr 27, 2011, 11:18 AM
29 Posts
Re: It looks to me like it's working correctly...
 Thank you,  David, I'll work on that.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal