Most Cold Fusion developers overuse the # character. Here are a couple of rules that will help you decide when to “pound” your variables:
#’s are never needed around variable names used in Cold Fusion tag attributes, unless they occur within an attribute string.#’s are always needed around variables that occur outside of (or in between pairs of) Cold Fusion tags. In other words, variables that occur within a block of text (e.g. SQL code between<CFQUERY>and</CFQUERY>, text in a<CFMAIL>body) must be surrounded by#’s. Similarly, variables with a string (text within double quotes) must be surrounded by#’s too.
And those are the only places to use them.
Possibly related:
- No related posts
Tagged pound | Post a Comment


















Tell me about it! I’ve lost count of the number of times I’ve had to demonstrate the correct use of pound signs in CF.
This is a good article on the subject by Ben Forta: http://www.defusion.com/articles/index.cfm?ArticleID=26
June 23rd, 2005, at 11:58 am #Thanks for the link Martin. I already have it in my bookmarks. I thought that posting the two rules that Ben had written about would clear up any confusion surrounding the use of pound signs in ColdFusion.
June 23rd, 2005, at 12:59 pm #