Displaying Variable Output; Working With Cfml Expressions - MACROMEDIA COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX Getting Started

Building coldfusion mx applications
Table of Contents

Advertisement

Displaying variable output

Output is what remains after the ColdFusion server processes the CFML tags on a page. Usually
the output has two parts:
Information that the user sees (for example, a confirmation message)
Information that is stored by the server as a result of processing (for example, user input
collected from a form)
One of the tags that ColdFusion provides to display output is the
tag instructs ColdFusion to process all the code between the
syntax for the
cfoutput
<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
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

Working with CFML expressions

Expressions are an important part of the ColdFusion language. Expressions are a collection of
different elements, ColdFusion variables, functions, and operators. You can think of them as
strings of text that consist of one or more of the following elements:
Literal text (string), numbers, dates, and other values
Variables
Functions
Operators (
&
Many examples of expressions were shown in this chapter; for example:
#variables.my_full_name#
DateFormat(Now())
my_first_name= "Kaleigh"
When you build expressions in ColdFusion, you can include simple and complex elements; how
you represent these elements determines how ColdFusion processes your program.
tag looks like this:
for joining statements,
cfoutput
start and end tags. For example, the
cfoutput
for addition, and so on)
+

Working with CFML expressions

tag. The
cfoutput
cfoutput
start and end tags. The
23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

This manual is also suitable for:

Coldfusion mx

Table of Contents