> I am setting the index based on the first Integer value of a query
>
> <cfoutput>
> <cfloop query="Query">
> <cfset SESSION.AnArray[#Value1#][1] = #Value1# >
> <cfset SESSION.AnArray[#Value1#][2] = #Value2# >
> <cfset SESSION.AnArray[#Value1#][3] = #Value3# >
> <cfset SESSION.AnArray[#Value1#][4] = #Value4# >
> <cfset SESSION.AnArray[#Value1#][5] = #Value5#>
> </cfloop>
> </cfoutput>
>
> I then wish to test for the existence of a specifc index
>
> #SESSION.AnArray[2]#
You can't, actually. You can't use IsDefined to check the existence of an
array member, and there's no equivalent array function as there is with
Structures - StructKeyExists.
Arrays aren't generally intended to be used with noncontiguous ranges, so
you should never have to check for the existence of a member between the
first and the last members. If you plan to populate noncontiguous members of
an array, you might first initialize the values of the members using
ArraySet. For example, if I expect to insert values for members based on an
identity column in my database, which might be a noncontiguous range, I'd
first initialize all the array members from the first (1) to the last (the
highest identity value) with ArraySet.
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.