# Variables

A Web application page is different from a static Web page because it can publish data dynamically. This involves creating, manipulating, and outputting variables.

A variable stores data that can be used in applications. As with other programming languages, you'll set variables in ColdFusion to store data that you want to access later. And you'll reference a range of variables to perform different types of application processing.

There are a variety of variable types that you can create and reference in your ColdFusion applications. Also, ColdFusion variables are typeless, which means that you don't need to define whether or not the variable value is numeric, text, or time-date. See the CFML Language Reference for a complete list of variable types

The primary differences between variable types are where they exist, how long they exist, and where their values are stored. These considerations are referred to as a variable's scope.

You will learn more about scope as needed throughout this book.

For example, you would store a user's preferences in a variable in order to use that data to customize the page that's returned to the browser.

You don't use pound signs when you create the variable. However, when you want to display the value that a variable is set to, enclose the variable name in pound signs (#). The following table illustrates the use of pound signs and variable names.

CFML Code | Results
--- | ---
    <CFSET Department="Sales">
| The variable named Department is created and the value is set to Sales.
    <CFOUTPUT>
    I'd like to talk to someone in
    Department.
    </CFOUTPUT>
| ColdFusion doesn't treat Department as a variable because it isn't surrounded by pound signs. The HTML page will display: I'd like to talk to someone in Department.
    <CFOUTPUT>
    I'd like to talk to someone in
    #Department#.
    </CFOUTPUT>
| ColdFusion replaces the variable Department with its value. The HTML page will display: I'd like to talk to someone in Sales.