Basicly I dont want to use a CF array. I want to make some array using the
CFOBJECT tag, say an array of ints

int[][] someInt

Now I want to be able to do a cfset and access an element of that array I
just created using CFOBJECT

<cfset someInt[0][0] = 2>
<cfset someInt[0][1] = 99>

But when I make an object using CFOBJECT, I cant specify [][]? Maybe im just
going mad..

-Ahnu


----- Original Message ----- 
From: "Dave Watts" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 10:36 AM
Subject: RE: CFOBJECT and 2D array


> > 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
                                

Reply via email to