Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfset vs cfparam

Participant ,
Mar 19, 2009 Mar 19, 2009
Hi guys,
Can you tell me in simple short english the difference between cfset and cfparam?
5.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 19, 2009 Mar 19, 2009
There are several differences.

Loosely put, the primary difference is that cfparam sets the value of a variable _only_ if that variable does not exist. Whereas cfset always sets the value of a variable. ie If the variable exists, it overwrites the existing value. If it does not exist, it creates one.

But again, there are several differences. That is only one.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 19, 2009 Mar 19, 2009
Not good enough....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 22, 2009 Mar 22, 2009
LATEST
quote:

Originally posted by: emmim44
Not good enough....

In what way?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 19, 2009 Mar 19, 2009
> Not good enough....

You've been reading "How to Win Friends and Influence People", I see.

You could - of course - just go read the docs. They're fairly explicit on
what each does:

<cfset>
http://livedocs.adobe.com/coldfusion/8/Tags_r-s_17.html


<cfparam>
http://livedocs.adobe.com/coldfusion/8/Tags_p-q_01.html

CFSearching (you people sure do have weird names) gave you a good start,
and explaining how 90% of people probably utilise the differences between
<cfset> and <cfparam>.

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 19, 2009 Mar 19, 2009
Adam Cameron wrote:
> you people sure do have weird names

I have never read your bio. But your dry wit makes one suspect you are British. (No that is not an insult. I just enjoy a dry sense of humor 😉
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2009 Mar 21, 2009
Hey this should not be tough:
CFSET - this tag will overwrite a variable to the value specified
CFPARAM - if the variable specified already exists then leave it alone otherwise it creates and set it to the value of the DEFAULT parameter.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 21, 2009 Mar 21, 2009
Semaphorians wrote:
> Hey this should not be tough

If the explanations provided are "not good enough", they should just read the documentation.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2009 Mar 21, 2009
@ Emmim44
Can you tell me in simple short english the difference between cfset and cfparam?

@ -==cfSearching==-
the primary difference is that cfparam sets the value of a variable _only_ if that variable does not exist. Whereas cfset always sets the value of a variable. ie If the variable exists, it overwrites the existing value. If it does not exist, it creates one.

In my opinion, the essence of the matter. It doesn't get better than that.

@ Emmim44
Not good enough.... Can you tell me in simple short english the difference between cfset and cfparam?

'Course. The one is es-ee-tee, the other pee-ay-are-ay-em.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources