MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 20

Building coldfusion mx applications
Table of Contents

Advertisement

Functions and number signs
You use number signs (#) with functions to display the results of a function on the page. Number
signs tell the ColdFusion server to evaluate the content between the number signs and display the
value, for example:
<cfoutput>
Hello world, <br>
Today's date is #DateFormat(Now(), "mm/dd/yyyy")#
</cfoutput>
The following figure shows the output of this example:
If you did not include the number signs around the
function, ColdFusion would not evaluate the function and the previous example would display
your source code, as follows:
For more information about how to use number signs with functions, see ColdFusion MX
Developer's Guide.
Functions and parentheses
All functions have parentheses, regardless of whether the function acts on data. Consider the
following function:
#Now()#
If you put anything inside the parentheses of the
function returns an unformatted date and time. However, you can format the results of
Now()
this function with other functions, such as the
20
Chapter 2: CFML Basics
DateFormat(Now(), "mm/dd/yyyy")
function, an error would occur. The
Now()
or
DateFormat()
TimeFormat()
functions.

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents