Cfscript - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

184

CFSCRIPT

The CFSCRIPT tag encloses a code segment containing CFScript.
Syntax
<CFSCRIPT>
CFScript code goes here
</CFSCRIPT>
Usage
Use CFSCRIPT to perform processing in CFScript instead of CFML. Note the following
regarding CFScript:
CFScript uses ColdFusion functions, expressions, and operators
You can read and write ColdFusion variables inside of CFScript
One use of CFSCRIPT is to wrap a series of assignment functions that would otherwise
require CFSET statements.
For more information on CFScript, see Developing Web Applications with ColdFusion.
Example
<!--- This example shows the use of CFSCRIPT --->
<HTML>
<HEAD>
<TITLE>CFSCRIPT Example</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFSCRIPT Example</H3>
<P>CFSCRIPT adds a simple scripting language to ColdFusion
for those developers who are more comfortable with JavaScript
or VBScript syntax.
<P>This simple example shows variable declaration and
manipulation.
<CFIF IsDefined("form.myValue")>
<CFIF IsNumeric(form.myValue)>
<CFSET x= form.myValue>
<CFSCRIPT>
y = x;
z = 2 * y;
StringVar = form.myString;
</CFSCRIPT>
<CFOUTPUT>
<P>twice #x# is #z#.
<P>Your string value was: <B><I>#StringVar#</I></B>
</CFOUTPUT>
<CFELSE>
...
CFML Language Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents