Copy link to clipboard
Copied
I am looping over an array It works fine if all variables are declared in array, I am trying to skip the entire process even if one variable is not declared I tried using isdefined, I tried to use cftry and cfcatch... nothing working any suggestions......
Copy link to clipboard
Copied
trim each element and check to see if the length is greater than 0.
Do this before you even create and populate the array.
Copy link to clipboard
Copied
It gives this kind of error when I am trying to check the length
Element 7 is undefined in a Java object of type class coldfusion.runtime.Array. | |
The error occurred in E:\www\test\codes.cfm: line 727 | |
725 : <td>#da |
Copy link to clipboard
Copied
That error is telling you that you are referencing the 7th element of a 6 element array.
I.E. ca[7] does not exist.
Copy link to clipboard
Copied
Is there a way to weather an element in an array is decleared ?
Copy link to clipboard
Copied
arrayLen(ca) would probably tell you all you want to know, but there are other interesting array related functions listed in the documentation as well.