> How can I test, whether exist a Array, such as
> MyArray[1][1][8][1][6][4]
> The example works not right.
> What can I do????
>
> example:
> <CFSET A = ArrayNew(2)>
> <CFSET A[1][1] = "a1"> <CFSET A[1][2] = "a1"> <CFSET A[1][5] = "a5">
> <cfloop index="i" from="1" to="#ArrayLEN(A[1])#" step="1">
> <cfoutput> Array A[1]#i#
> <cfif IsDefined(A[1][i])>
> exist
> <cfelse>
> not exist
> </cfif><br>
> </cfoutput>
> </cfloop>
You can't use IsDefined to check for the existence of an array member, only
for the array itself. You can reference the possibly non-existent member
within a CFTRY/CFCATCH, or you can use ArraySet to initialize all your array
members so that you don't have non-contiguous array elements.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.