Using Prefixes

ColdFusion supports many variable types, and you’ll become very familiar with them as you work through this book. For example, local variables (the type you just created) are a variable type. Submitted form fields are a variable type, as are many others.

ColdFusion variables can be referenced in two ways:

  • The variable name itself.

  • The variable name with the type as a prefix.

For example, the variable firstName that you used a little earlier is a local variable (type VARIABLES). That variable can be referred to as firstName (as you did previously) and as VARIABLES. firstName. Both are valid, and both will work (you can try editing file hello6.cfm to use the VARIABLES prefix to try this).

So, should you use prefixes? Well, there ...

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.