![MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Скачать руководство пользователя страница 605](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-cfml-language/coldfusion-4-5-cfml-language_reference_3287257605.webp)
Chapter 4: ColdFusion Expressions: Operators and Other Constructs
581
Pound Signs
Pound signs (#) have special meaning in ColdFusion. When a CFML application page
is processed, ColdFusion treats text delimited by pound signs differently from plain
text.
Two simple and very important points about pound signs in CFML are:
•
Use pound signs to distinguish expressions from plain text.
•
When expressions are evaluated, the resulting value is substituted for the
expression text.
For example, to output the current value of a variable named “Form.MyFormVariable,”
you must delimit the variable name with pound signs:
<CFOUTPUT>Value is #Form.MyFormVariable#</CFOUTPUT>
When ColdFusion processes an expression, it replaces the text of the expression and
the two pound signs around it with its resulting value. In the example above, the
expression #Form.MyFormVariable# is replaced with whatever value has been
assigned to it.
While the guidelines for using pound signs in CFML are simple, there is still some
possibility for confusion to arise. This is particularly true in cases where expressions
and plain text are mixed together. The following sections provide more details on how
pound signs should be used in CFML.
Pound signs inside CFOUTPUT tags
Expressions containing a single variable or a single function can be used freely inside
CFOUTPUT tags as long as they are enclosed in pound signs.
<CFOUTPUT>
Value is #Form.MyTextField#
</CFOUTPUT>
<CFOUTPUT>
The name is #FirstName# #LastName#.
</CFOUTPUT>
<CFOUTPUT>
Cos(0) is #Cos(0)#
</CFOUTPUT>
If pounds are not used around these expressions, the expression text rather than the
expression value will appear in the output generated by the CFOUTPUT statement.
Note that two expressions inside pound signs can be adjacent to one another, as in
<CFOUTPUT>
"Mo" and "nk" is #Left("Moon", 2)# #Mid("Monkey", 3, 2)#
</CFOUTPUT>
Содержание COLDFUSION 4.5-CFML LANGUAGE
Страница 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Страница 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Страница 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Страница 296: ...272 CFMLLanguageReference INPUT TYPE text NAME number2 BR INPUT TYPE submit NAME submit VALUE Add FORM BODY HTML...
Страница 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Страница 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Страница 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Страница 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Страница 557: ...Chapter 2 ColdFusion Functions 533 P CFOUTPUT Value i is employee keysToStruct i CFOUTPUT P CFLOOP CFIF BODY HTML...
Страница 584: ...560 CFMLLanguageReference...
Страница 594: ...570 CFMLLanguageReference...