As with any programming tool, you cannot use just any word or name for ColdFusion variables, UDFs and custom tags. Avoid using any name that can be confused with a ColdFusion element. In some cases, if you use a word that ColdFusion uses — for example, a built-in structure name — you can overwrite the ColdFusion data.
The following list indicates words you must not use for ColdFusion variables, user-defined function names, or custom tag names. While some of these words can be used safely in some situations, you can prevent errors by avoiding them entirely. For a complete list of reserved words, see the CFML Reference.
- Built-in function names, such as Now or Hash
- Scope names, such as Form or Session
- Any name starting with cf. However, when you call a CFML custom tag directly, you prefix the custom tag page name with cf_.
- Operators, such as NE or IS
- Names such as Function, Abstract, or Null.
Note: If this.enableNullSupport = true, you cannot use Null as a keyword.
- The names of any built-in data structures, such as Error or File
- The names of any built-in variables, such as RecordCount or CGI variable names
- CFScript language element names such as for, default, or continue
Also, do not create form field names ending in any of the following, except to specify a form field validation rule using a hidden form field name. (For more information on form field validation, see Introduction to Retrieving and Formatting Data.)
- _integer
- _float
- _range
- _date
- _time
- _eurodate
Because ColdFusion is not case-sensitive, all of the following are reserved words: IS, Is, iS, and is.
- The following language elements are keywords in a script syntax:
- for
- default
- switch
- case
- continue
- import
- finally
- final
- local (inside function declaration)
- interface
- pageencoding
- return
- try
- catch
- in
- else
- if
- while
- do
- break
- The following elements are reserved in both script and tags:
- function
- true
- false
- final
- abstract
- null – can be used as variable names but not as User-Defined Function name.