YES!

I just saw the reference to this in Spike's post (if named wrong, but I
found the method he meant).

This is great news.  I've hunted high and low for this... Even through
getPageContext(), as it happens... But just never spotted it.  D'oh!

This is the single best result I've had from this mailing list.

You guys rock.

Adam


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Roland Collins
Sent: Saturday, 20 March 2004 11:18 a.m.
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Unscoped references in CFSET within CFFUNCTION



>It's also a right pain in the arse that one cannot iterate over the 
>function local scope (well: no way that I've found, anyhow, so I'm all 
>ears if someone else can do it :-), with a for-in loop, or a
>structKeyArray() or something similar.

Here you go!  Add this to your CFFUNCTION

<CFSET oVarScope = getPageContext().getActiveFunctionLocalScope()>

<CFLOOP COLLECTION="#oVarScope#" ITEM="oVar">
        <CFIF oVar IS NOT "this"
                AND oVar IS NOT "arguments"
                AND NOT StructKeyExists(arguments, oVar)
                AND NOT StructKeyExists(this, oVar)>
                <CFSET oVarName = oVar>
                <CFSET oVarValue = Evaluate("oVarScope.#oVarName#")>
                
                <CFSET WriteOutput(oVarName & " = ")>
                <CFDUMP VAR="#oVarValue#">
        </CFIF>
</CFLOOP>

Modify as necessary and you can easily loop over the var scope!!!

Roland Collins
CTO, InvestEdge


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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 words '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