Hello
I'm trying to access the dataObject in reverse order - that is, I'm adding PDFs to a package and I've got a field to show the contencts of the package - this part works great. However, I want the PDF added last to be on the top of my list. This is my coded, the first part works fine, but when I try decrementing the var i, it falls over. Any thoughts would be much appreciated.
regards
brian
var d = this.dataObjects;
for (var i = 0; i < d.length; i++)
// for (var i = d.length; i > 0; i--)
console.println("Data Object [" + i +"] = "+d[i].path);
Data Object [0] = Onetel.pdf
Data Object [1] = Craft - orderNum12560.pdf
true
=======================================================
var d = this.dataObjects;
// for (var i = 0; i < d.length; i++)
for (var i = d.length; i > 0; i--)
console.println("Data Object [" + i +"] = "+d[i].path);
d[i] has no properties
4:Console:Exec
undefined
Try this:
for (var i = d.length -1; i>=0; i--)the problem is the initial value of d.length was 4 and there was no forth element in the array thus the error message
d[i] has no properties
4:Console:Exec
undefined