Ever find yourself repeatedly checking if a variable exists (using the IsDefined() function) and then checking it’s value? A faster (and more manageable) approach is to always ensure that variables exists with a bank of statements at the top of your page. Use these statements to assign default values (perhaps empty strings using “”). This way you can just check values, and not have to concern yourself with whether or not the variables exist – they’ll always exist. (Applies to: ColdFusion 3 (or later))

Leave a Reply