Building Expressions

Expressions are entered where necessary. Expressions can be passed to a <cfset> statement as part of an assignment, used when displaying text, and passed to almost every single CFML tag (except for the few that take no attributes).

Simple expressions can be used, such as those discussed previously (variables, functions, and combinations thereof). But more complex expressions can be used, too, and expressions can include arithmetic, string, and decision operators. You’ll use these in the next few chapters.

When using expressions, number signs are used to delimit ColdFusion functions and variables within a block of text. So, how would you display the # itself? Look at the following code snippet:

<cfoutput> #1: #FirstName# ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.