Macromedia coldfusion 4.5-cfml language reference Benutzerhandbuch

Seite von 608
Chapter 2:  ColdFusion Functions
335
DE
Returns its argument with double quotes wrapped around it and all double quotes 
inside it escaped. The DE (Delay Evaluation) function prevents the evaluation of a 
string as an expression when it is passed as an argument to IIf or Evaluate.
See also 
Evaluate
 and 
IIf
.
Syntax
DE(
string)
string
String to be evaluated with delay.
Examples
<!--- This shows the use of DE and Evaluate --->
<HTML>
<HEAD>
<TITLE>
DE Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>DE Example</H3>
<CFIF IsDefined("FORM.myExpression")>
<H3>The Expression Result</H3>
<CFTRY>
<!--- Evaluate the expression --->
<CFSET myExpression = Evaluate(FORM.myExpression)>
<!--- Use DE to output the value of the variable, unevaluated --->
<CFOUTPUT>
<I>The value of the expression #Evaluate(DE(FORM.MyExpression))#
is #MyExpression#.</I>
</CFOUTPUT>
<!--- specify the type of error for which we are fishing --->
<CFCATCH TYPE="Any">
<!--- the message to display --->
<H3>Sorry, there’s been an <B>Error</B>.
Try a simple expression, such as "2+2".</H3>
<CFOUTPUT>
<!--- and the diagnostic message from ColdFusion Server --->
    <P>#CFCATCH.message#
</CFOUTPUT>
</CFCATCH>
</CFTRY>
</CFIF>
...