Macromedia ColdFusion variables are the most frequently used operands in ColdFusion
expressions. Variable values can be set and reset, and can be passed as attributes to CFML tags.
Variables can be passed as parameters to functions, and can replace most constants.
This chapter describes how to create and use ColdFusion variables. It includes the following
information:
•
How variables can represent different types of data
•
How the data types get converted
•
How variables exist in different scopes
•
How the scopes are used
•
How to use variables correctly
Contents
Creating variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Variable characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Data type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
About scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Validating data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Using ColdFusion Variables
CHAPTER 3
53
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers