How about this (since Form and URL are implemented as structures in CF4.5):
<cfloop collection="#form#" item="i">
    <cfset setvariable(i,form[i])>
</cfloop>
<cfloop collection="#url#" item="i">
    <cfset setvariable(i,url[i])>
</cfloop>

Personally, I just use unscoped variables (but preface them with "ff".)
Call me a heretic :-)

BTW I registered "www.cfprimer.com" for Daryl's ColdFusion Primer.  So both
of you who bookmarked it, change your bookmarks ;-)

Daryl Banttari
Sr. Consultant
Macromedia Consulting

----- Original Message -----
From: "Bryan LaPlante" <[EMAIL PROTECTED]>
To: "[KCFusion List] (E-mail)" <[EMAIL PROTECTED]>
Sent: Sunday, April 08, 2001 10:11 PM
Subject: [KCFusion] FYI


> Hay all,
> I kept threatening to build a loop that could be used to assign var's
> dynamically but just never found a need to do it before.
>
> For example if you have an action page that might get url var's in one
> situation and form var's in another, it is a time consuming hassle to
write
> the if/else structure for each scope of variable.
> Any way I broke down and wrote one for my self, so I thought I would just
> share it with you all.
>
> <CFLOOP INDEX="var" LIST="custemail,custurl,productID">
>  <CFIF IsDefined("form." & var)>
>   <CFSET Evaluate(var & "=" & "form." & var)>
>  <CFELSEIF IsDefined("URL." & var)>
>   <CFSET Evaluate(var & "=" & "URL." & var)>
>  </CFIF>
> </CFLOOP>
>
> Bryan LaPlante
> 816-347-8220
> [EMAIL PROTECTED]
> http://www.netwebapps.com
> Web Development
>
>
>
> ______________________________________________________________________
> The KCFusion.org list and website is hosted by Humankind Systems, Inc.
> List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org
> Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
> To Subscribe.................... mailto:[EMAIL PROTECTED]
> To Unsubscribe................ mailto:[EMAIL PROTECTED]
>


 
 
______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]
 

Reply via email to