Well, this may be too common to actually be a "trick" but I'll give it a shot.  Sometimes I want a template/fuse to accept input from a form and other times from a query string.  To handle both situations, I set the variable default value like this:


<CFPARAM NAME="URL.FooBar" DEFAULT="">
<CFPARAM NAME="Form.FooBar" DEFAULT="#URL.FooBar#">

And then use Form.FooBar throughout the rest of the template.

Chris

-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 12:43 AM
To: CF-Talk
Subject: Favorite CF Variable Tricks and Techniques

I'm doing a presentation for the Boston CFUG Wednesday on Variables in CF
(how to use them, scopes, tricks, etc).  I've got a lot of material (mostly
from the large guide to CF variables I authored here:
http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/Varia
bles/Index.cfm ) but would like some more interesting code bites.

I'm interested mostly in "tricks" with CF variables (types, scopes, etc)
that may not be obvious.  For example I'll be covering in some detail how a
query column can be used as an array for most array functions and some
others.

I'll be covering dynamic variable access/assignment using bracketed notation
(something I still don't see enough - the evaluate() function just won't
seem to die).  I'll also be covering a lot of other things but I'd like some
more.

Any techniques/tricks/observations that anybody would like to share that fit
in this vein would be greatly appreciated.  I'll gladly give credit in the
presentation and, once I finally update it, in the guide to variables as
well.

Thanks in advance,

Jim Davis
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to