Using Functions

This is where it starts to get interesting. CFML (the ColdFusion Markup Language) is made up of two primary language elements:

  • Tags. These perform operations, such as accessing a database, evaluating a condition, and flagging text for processing.

  • Functions. These return (and possibly process) data and do things such as getting the current date and time, converting text to uppercase, and rounding a number to its nearest integer.

Writing ColdFusion code requires the use of both tags and functions. The best way to understand this is to see it in action. Here is a revised hello page. Type Listing 8.2 in a new page, and save it as hello2.cfm in the ows/8 directory.

Listing 8.2. hello2.cfm
<html> <head> <title>Hello 2</title> </head> ...

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.