I pulled this note right out of the help file of coldfusion:
Note: The IsDefined function does not test the existence of array elements. To test whether data exists at an array index, copy the array element to a simple variable and use the IsDefined function to test the existence of the copy.
Well, what am I doing wrong then? Here is my code:
<cfset exceptArray = exceptions[#thisday#][1]>
<cfif IsDefined("exceptArray"
>
<cfif #exceptArray# eq #CurrentDay#>
#CurrentDay#
</cfif>
</cfif>
There are only 2 sets of data in this array, [1][1], [2][1].
So when it looks for the third set it should skip the code and continue processing, except I receive this error message:
The element at position 1, of dimension 2, of an array object used as part of an expression, cannot be found.
How do I test if [3][1] exists, and if not, just continue?
Note: The IsDefined function does not test the existence of array elements. To test whether data exists at an array index, copy the array element to a simple variable and use the IsDefined function to test the existence of the copy.
Well, what am I doing wrong then? Here is my code:
<cfset exceptArray = exceptions[#thisday#][1]>
<cfif IsDefined("exceptArray"
<cfif #exceptArray# eq #CurrentDay#>
#CurrentDay#
</cfif>
</cfif>
There are only 2 sets of data in this array, [1][1], [2][1].
So when it looks for the third set it should skip the code and continue processing, except I receive this error message:
The element at position 1, of dimension 2, of an array object used as part of an expression, cannot be found.
How do I test if [3][1] exists, and if not, just continue?