CFSET is for defining a variable.
  CFPARAM is checking a variables existance, and if it is not defined, 
give it a default value, otherwise leave it's value alone.

  CFSET is more efficient (I've been told) so do not use CFPARAM as a 
replacement for CFSET.  

  this code:

  <CFIF not isDefined("myvar")>
    <CFSET myvar = 1> 
  </CFIF>


  Would be the same as:

  <CFPARAM name="myvar" default="1">


  If you mean to be passing information into a page, do not use CFPARAM 
to define defaults for that information.  I heard one story where a 
person had a hard time debugging a shopping cart type of application.  At 
the end of the 'line' he had lost his data.  At one point, he was improperly
passing the variables, but his application never spit up and said "Hold 
it, these variables aren't defined" because he was giving them defaults.

  Does this help?


Eric Fickes wrote:
> 
> Could anybody school me in the difference between using CFPARAM and CFSET.
> I see CFPARAM all the time, but the little documentation that I've seen
> about CFPARAM makes it sound just like CFSET.
> 
> E
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to