The URL and FORM scopes are structures. I think this applies to all scopes
but can't be sure.

You can use the StructKeyArray(Structure) to return an array of the key
elements in a structure.  So, if you feed the function the name of the
scope, you get an array of the variable names.

then doing an loop based on the length of the array, you can find the
values.

Here's a sample for the URL scope that I've come up with:

<cfscript>
if (len(CGI.Query_String) gt 0)
{
        URLArray = StructKeyArray(URL);
        for (x = 1; x lt arraylen(URLArray); x = x +1)
        {
                URL[URLArray[x]] = REReplaceNoCase(URL[URLArray[x]], "[']",
chr(96), "ALL");
                URL[URLArray[x]] = REReplaceNoCase(URL[URLArray[x]],
"<[^>]*>", "", "ALL");
        }
}
</cfscript>


HTH

Shawn Grover

-----Original Message-----
From: Leon Oosterwijk [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 12:15 PM
To: CF-Talk
Subject: Attributes Scope Variable List


All, 

Is it possible to find out all the variables that are declared in a certain
scope? I'm trying to loop over all the variables in the Attributes Scope and
insert their contents in hidden form fields. I was wondering if anyone has
accomplished something like this. 

Leon Oosterwijk
ISDN-NET Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to