> I need a one sentence "rule of thumb" that explains how and when
> to use #'s in code:
>
> Old way:
> <cfset var1 = #RandRange(1,6)#> <-- the #'s are not needed
>
> New way:
> <cfset var2 = RandRange(1,6)> <-- cleaner, faster, better
>
> There are obvious exceptions to this rule (within CFOUTPUT, and within
> certain tags like <cfloop from="#var1#"...), and the exceptions should be
> included in the rule of thumb.
>
> Anyone know how to say it cleanly?
Check out Uncle Ben's article "To # or not to #"
http://www.defusion.com/articles/index.cfm?ArticleID=26
But generally;
as part of a CFSet, you don't need them
as a parameter, you do need them
within a string (in quotes), you do need them
to output a variables, you OBVIOUSLY need them
As a color definition, you double them, but only inside a CF command like
CFOutput or a string
HTH
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists