Thanks for that Paul

On the line where you have LOCAL.tmpObj = new steve(local.i);, is the cfc
steve.cfc? and are you meant to import anything else or can you do that with
any cfc?

-----Original Message-----
From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Thursday, 14 July 2011 8:55 AM
To: cfaussie
Subject: [cfaussie] Re: CreateObject of itself

Hi Steve,

I believe this is what your trying to achieve:

http://pastebin.com/hJmsEvaA

Running code: http://demo.kukiel.net/cfaussie.cfm

Paul

On Jul 13, 8:37 pm, "Steve Onnis" <st...@cfcentral.com.au> wrote:
> Can anyone suggest a way i can create a new reference to a cfc that i am
> already in?
>
> Something like....
>
> FooBar.cfc
>
> <cfcomponent>
>
>       <cfproperty name="fooProp" type="string" />
>
>       <cffunction name="bar" output="false">
>
>             <cfscript>
>
>                   LOCAL.tmpArr = [];
>
>                   for (LOCAL.i = 1; LOCAL.i LTE 10; LOCAL.i = LOCAL.1+1) {
>
>                         LOCAL.tmpObj = new this;
>
>                         LOCAL.tmpObj.setfooBar("Some String #LOCAL.i#");
>
>                         ArrayAppend(LOCAL.tmpArr, LOCAL.tmpObj);
>
>                         }
>
>             </cfscript>
>
>       </cffunction>
>
> </cfcomponent>
>
> Obviously "new this;" wont work.
>
> I want something to replace
>
> LOCAL.tmpObj = createObject("COMPONENT", "FooBar");
>
> Ideas?
>
> Steve

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to