Here's a common use for CFParam ... at least for me ...

Let's say I have a form that can be used either for updating existing data
OR for inserting new data.  

If the form will function as update, I'll want to display the existing data,
such as:

<cfinput type=text name=fname value="#finddata.fname#">

That's fine so long as I have a query running called "finddata"

But when the from is called for a new insert, chances are, I haven't run the
query.  So, in that case, #findata.fname# will throw and error.

But if I start my template with:

<cfparam name="finddata.fname" default="">

Now my value in the cfinput tag will show blank and not throw an error.

That's a rather simplified version of how I might use CFParam.  Basically,
it's a way of making sure a default variable exists in cases where a dynamic
variable might not otherwise exist.  Many times, you need to make sure a
variable exists, but you are not ready to populate that variable with a
meaningful variable.  Or sometimes, you want a meaningful variable to be the
default and only be changed as a result of some database or user
interaction.

H.




Howard Owens
Internet Operations Coordinator
www.insidevc.com
[EMAIL PROTECTED]
AIM: GoCatGo1956


> -----Original Message-----
> From: Fuon See Tu [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, September 04, 2001 1:49 PM
> To:   CF-Talk
> Subject:      CFPARAM vs. CFSET
> 
> Hey guys i still don't understand the difference between CFPARAM and
> CFSET.  
> anyone got a working concept?  i see no use for CFPARAM :)
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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