CF Param is working as it's supposed to.  CFPARAM encapsulates the follow
ing
logic:


Your first cfparam does this....

IF ( NOT IsDefined('foo') ) {   foo  = bar; }

Your second one does this.....

IF ( NOT IsDefined('foo') ) {   foo  = boo; }


The first one executes and defines foo and assigns it the value "bar".


The second IF does trigger because Foo IS defined. You use cfparam to
either predifine a varialble to avoid a page error (as in when you are
populating form
fields with their own submitted values) and/or to set a default value in 
the
case where
a variable has not yet been assigned.

Mark


-----Original Message-----
From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 8:06 AM
To: CF-Talk
Subject: CFPARAM Question


Do subsequent CFPARAMS of the same variable overwrite each other? I
thought so, but they don't seem to.

<CFPARAM NAME="foo" DEFAULT="bar">

. later ...

<CFPARAM NAME="foo" DEFAULT="boo">

If I check for foo it's still "bar" instead of "boo"...

Is there a way to duplicate my intended behavior another way?

Tony Schreiber, Senior Partner                  Man and Machine, Limited
mailto:[EMAIL PROTECTED]                   http://www.technocraft.com

http://www.simplemessageboard.com ___Free Forum Software for Cold Fusion
http://www.is300.net ___________The Enthusiast's Home of the Lexus IS300
http://www.digitacamera.com ______________DigitA Camera Scripts and Tips
http://www.linklabexchange.com _____________Miata Link ECU Data Exchange

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to