Yep,

What I am referring to is that you can dynamically set the return type ie

<cfunction name="init" returnType="#dynamicReturnType#" />

or

<cfunction name="init" returnType="#getMetaData(this).Name#" />

They will both fail.

The return type must be specified at compile time ie

<cfunction name="init" returnType="demoCompoent" />

Paul

On Mon, Jul 18, 2011 at 8:36 PM, Andrew Scott <andr...@andyscott.id.au>wrote:

> Paul, I am going to correct you here.
>
> When creating the constructor, whether it be init or initmethod="whatever"
> you can return the object type.
>
> public testComponent function() {
> }
>
> Also notice that I didn't include the return this, because in ColdFusion 9
> this will work without it. What you can't do is dynamically change the
> return type.
>
>
>
>
> On Thu, Jul 14, 2011 at 1:23 PM, Paul Kukiel <kuki...@gmail.com> wrote:
>
>> Hi Steve,
>>
>> That's correct the cfc was called steve.  I didn't need to import anythign
>> as I just dropped the cfc in the same folder.
>>
>> If the cfc was in a folder say com.cfaussie or there was a com mapping the
>> import would be:
>>
>> <cfscript>
>> import com.cfaussie.steven;
>>
>> temp = new steven("zigZag2");
>>  temp.bar();
>>
>> writeDump(getMetaData(temp));
>>
>> </cfscript>
>>
>> In the cfc it knows where it is so you don't need the import.  Also
>> getMetaData() will return the meta data Phill was mentioning and you could
>> use fullName to dynamically create the new instance.  Return type of init
>> must be any however as you can't change that at run time.
>>
>> Eg:  http://pastebin.com/ZeE0rpYJ
>>
>> Running: http://demo.kukiel.net/cfaussie2.cfm
>>
>> Paul
>>
>>  --
> 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.
>



-- 
Paul Kukiel

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