Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Using pound signs > Using pound signs in tag bodies PreviousNext

Using pound signs in tag bodies

You can put variables or functions freely inside the bodies of the following tags by enclosing each variable or expression with pound signs:

For example:

<cfoutput>
   Value is #Form.MyTextField#
</cfoutput>

<cfoutput>
   The name is #FirstName# #LastName#.
</cfoutput>

<cfoutput>
   The value of Cos(0) is #Cos(0)#
</cfoutput>

If you omit the pound signs, the text, rather than the value, appears in the output generated by the cfoutput statement.

Two expressions inside pound signs can be adjacent to one another, as in the following example:

<cfoutput>
   "Mo" and "nk" is #Left("Moon", 2)##Mid("Monkey", 3, 2)#
</cfoutput>

This code displays the following text:

"Mo" and "nk" is Monk

ColdFusion does not interpret the double pound sign as an escaped # character.


Contents > Developing ColdFusion MX Applications > Using Expressions and Pound Signs > Using pound signs > Using pound signs in tag bodies PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/exprea15.htm