> Im trying to make an array of objects in CFMX. This array > will be a 2 dimensional array. My problem is that I dont know > how to access the elements of a 2D array using CFOBJECT and > Im not sure how to specify the creation of a 2D array in the > constructor method. Here is what little I know: > > <cfobject action="create" type="Java" > class="java.lang.Object" name="myObject"> > <cfset searchObject = myObject.init()> > > I'd like to be able to do: > > <cfset searchObject[0][0]= "some number"> > <cfset searchObject[0][1] = "some text"> > > Basicly Id like to make multi dim arrays of any type using > CFOBJECT, any thoughts would be appreciated.
I'm a little confused. If "myObject.init()" doesn't return an array, then you won't be able to refer to it as an array, by itself. However, if you want to create the objects and store them in an array yourself, I don't see why you can't do that: <cfset myObjArray = ArrayNew(1)> <cfobject action="create" type="Java" class="java.lang.Object" name="mytempobj"> <cfset myObjArray[1] = mytempobj> You might be able to just specify "myObjArray[1]" in the CFOBJECT tag's NAME attribute, but I've had problems with things like that before, so I didn't do it in this example. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

