Drop this in your CFC then execute it from within:

 

<CFFUNCTION NAME="getVariablesScope" RETURNTYPE="struct" OUTPUT="false" ACCESS="private">

            <CFSCRIPT>

                        var stReturn = StructNew();

                        var oVar = "";

 

                        for (oVar IN variables)     {

                                    if (oVar IS NOT "this" AND NOT StructKeyExists(this, oVar))

                                                stReturn[oVar] = variables[oVar];

                        }

                       

                        return stReturn;

            </CFSCRIPT>

</CFFUNCTION>

 

Hope this helps,

Roland

 

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim McMullen (Devlab)
Sent: Thursday, April 15, 2004 4:13 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Getting the names of Variables in Variables Scope

 

Is there a way to create a list of the variable names of instance data in the variables scope without assembling it manually?

 

I thought I could do this...

 

<cffunction name="getVariablesKeyList" returntype="string" access="public">

    <cfreturn StructKeyList(variables)>

</cffunction>

 

...But of course in addition to all the variable names, this function also adds to the list the names of all the CFC's functions, the word "this", the word "variables", etc.

 

Anyone got a better idea or a UDF I can use? Thanks.

 

Jim McMullen

Devlab, Inc.

 

 

Reply via email to