23.08.2013 Views

ColdFusion Developer's Guide - Electromanuals.org

ColdFusion Developer's Guide - Electromanuals.org

ColdFusion Developer's Guide - Electromanuals.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Character case<br />

Ofrecido por www.electromanuales.com<br />

ADOBE COLDFUSION 8<br />

<strong>ColdFusion</strong> Developer’s <strong>Guide</strong><br />

<strong>ColdFusion</strong> is case-insensitive. For example, the following all represent the cfset tag: cfset, CFSET, CFSet, and<br />

even cfsEt. However, you should get in the habit of consistently using the same case rules in your programs; for<br />

example:<br />

• Develop consistent rules for case use, and stick to them. If you use lowercase characters for some tag names, use<br />

them for all tag names.<br />

• Always use the same case for a variable. For example, do not use both myvariable and MyVariable to represent<br />

the same variable on a page.<br />

Follow these rules to prevent errors on application pages where you use both CFML and case-sensitive languages,<br />

such as JavaScript.<br />

Special characters<br />

The double-quotation marks ("), single-quotation mark ('), and number sign (#) characters have special meaning to<br />

<strong>ColdFusion</strong>. To include any of them in a string, double the character; for example, use ## to represent a single #<br />

character.<br />

The need to escape the single- and double-quotation marks is context-sensitive. Inside a double-quoted string, you<br />

do not need to escape single-quotation mark (apostrophe) characters. Inside a single-quoted string, you do not<br />

escape double-quotation mark characters.<br />

The following example illustrates escaping special characters, including the use of mixed single- and doublequotation<br />

marks:<br />

<br />

<br />

<br />

#mystring#<br />

#mystring2#<br />

Here is a number sign: ##<br />

<br />

The output looks like this:<br />

We all said "Happy birthday to you."<br />

Then we said "How old are you now?"<br />

Here is a number sign: #<br />

Reserved words<br />

As with any programming tool, you cannot use just any word or name for <strong>ColdFusion</strong> variables, UDFs and custom<br />

tags. You must avoid using any name that can be confused with a <strong>ColdFusion</strong> element. In some cases, if you use a<br />

word that <strong>ColdFusion</strong> uses—for example, a built-in structure name—you can overwrite the <strong>ColdFusion</strong> data.<br />

The following list indicates words you must not use for <strong>ColdFusion</strong> variables, user-defined function names, or<br />

custom tag names. While some of these words can be used safely in some situations, you can prevent errors by<br />

avoiding them entirely. For a complete list of reserved words, see the CFML Reference.<br />

21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!