Contents > Getting Started Building ColdFusion MX Applications > CFML Basics > Understanding CFML elements > Displaying variable output PreviousNext

Displaying variable output

Output is what remains after the ColdFusion server processes the CFML tags on a page. Usually the output has two parts:

One of the tags that ColdFusion provides to display output is the cfoutput tag. The cfoutput tag instructs ColdFusion to process all the code between the cfoutput start and end tags. The syntax for the cfoutput tag looks like this:

<cfoutput>
{normal html, text, and coldfusion processing instructions}
</cfoutput>

To return the value of a variable, you must always surround the variable name with pound signs (#) and place the variable name between the cfoutput start and end tags. For example, the following code creates a variable and instructs the ColdFusion server to return the value of the variable:

<cfset my_first_name = "Kaleigh">
<cfset my_last_name = "Smith">
<cfset my_full_name = variables.my_first_name & " " & variables.my_last_name>
<cfoutput>
#variables.my_full_name# 
</cfoutput>

The following is the output:

Kaleigh Smith


Contents > Getting Started Building ColdFusion MX Applications > CFML Basics > Understanding CFML elements > Displaying variable output 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/cfml_b13.htm