I'd use arrays dor this, so you would have an array of objects.

myobjs = ArrayNew(1)
then
myobjs[i] = CreateObject("component", "foo").init()
then this should be doable
goo = myobjs[3].getAmount()

Doug

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Behalf Of James K Tieman
>Sent: Monday, October 13, 2003 12:07 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] Query Results into objects
>
>
>yes, but how do I refer to it later?
><cfset i = "001">
><cfset "obj#i#" = CreateObject("", "") does create the object.
>now, how do I access the object without knowing that it  is 
>now "obj001"?  I
>can't do this <cfset obj#i#.init()>, but I can, of course, do 
>this <cfset
>obj001.init()>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Behalf Of Adrian Lynch
>Sent: Monday, October 13, 2003 10:52 AM
>To: '[EMAIL PROTECTED]'
>Subject: RE: [CFCDev] Query Results into objects
>
>
>Can you still use <cfset "obj#i#" = CreateObject("", "") />?
>
>Ade
>
>-----Original Message-----
>From: Adam Wayne Lehman [mailto:[EMAIL PROTECTED]
>Sent: 13 October 2003 16:16
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] Query Results into objects
>
>
>What about:
>
>setVariable("obj" & i, createObject("component", "accounts"))
>
>Adam Wayne Lehman
>Web Systems Developer
>Johns Hopkins Bloomberg School of Public Health
>Distance Education Division
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>Behalf Of James K Tieman
>Sent: Monday, October 13, 2003 10:59 AM
>To: Cfcdev
>Subject: [CFCDev] Query Results into objects
>
>I want to create objects from a query recordset and I don't know how to
>name
>the objects so I can, for example, obj7.setAmount(obj1.getAmount() *
>obj4.getAmount()). <c<cfset obj#i# =
>CreateObject('component','accounts')>
><cfset obj#i#.init()>  I realize I'm showing my ignrnc, but 
>that's why I
>asking.
>
>Jamie
>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>An archive of the CFCDev list is available at
>www.mail-archive.com/[EMAIL PROTECTED]
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>An archive of the CFCDev list is available at
>www.mail-archive.com/[EMAIL PROTECTED]
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>An archive of the CFCDev list is available at
>www.mail-archive.com/[EMAIL PROTECTED]
>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>An archive of the CFCDev list is available at 
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to