View comments | RSS feed
Contents > CFML Reference > ColdFusion Tags > cfscript PreviousNext

cfscript

Encloses a code block that contains cfscript statements.

Application framework tags, Other tags

<cfscript> 
cfscript code here
</cfscript>

cfinvoke, cfmodule, CreateObject, Extending ColdFusion Pages with CFML Scripting in Developing ColdFusion MX Applications

ColdFusion MX:

Performs processing in CFScript. This tag uses ColdFusion functions, expressions, and operators. You can read and write ColdFusion variables within this tag.

For a detailed description of the CFScript scripting language, including documentation of CFScript statements and the CFScript equivalents of CFML tags, see Extending ColdFusion Pages with CFML Scripting in Developing ColdFusion MX Applications.

You can use this tag to enclose a series of assignment statements that would otherwise require cfset statements.

Caution: If you code a cftry/cfcatch block within this tag using an exception's Java class name, you must provide the fully-qualified class name.

You cannot use some ColdFusion reserved words in this tag. You cannot put a user-defined function whose name begins with any of these strings within this tag:

You cannot use the elseif construct within a cfscript tag. You can use code such as the following:

else if ( condition )
{
...
}

Contents > CFML Reference > ColdFusion Tags > cfscript PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


No screen name said on Sep 26, 2003 at 11:47 AM :
How about some syntax examples of what WILL work in a cfscript? How about some control structure examples, like how do i write an if then else statement, or a loop? Please be more helpful, particularly with the examples.
jrunrandy said on Sep 26, 2003 at 12:33 PM :
Try clicking the next arrow a couple of times. These pages have a few basic examples. Also, try the cfscript discussions in Developing ColdFusion MX Applications (go to http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/cfscript.htm and click the right arrow to page through the docs). Alternatively, you can view the PDF version of the docs(available from http://www.macromedia.com/support/documentation/en/coldfusion/ )
charmed0rz said on May 4, 2005 at 2:03 PM :
Here is an example of how I used it in my application

This.Name = 'MyApp'; //Application Name..
This.ApplicationTimeout = createtimespan(5,0,0,0); //Timeout in days,hours,minutes,seconds..
This.Session.Management = true; //Sessions are enabled
This.SessionTimeout = createtimespan(0,0,30,0); //When the session times out
This.ClientManagement = false; //enable client variables
This.Clientstorage = 'cookie'; //This can be cookie, registry, or a datasource name
This.SetClientCookies = true; //Send CFIF and CFTOKEN cookies to the client
This.SetDomainCookies = false;// This is 'true' for applications running on CF server cluster
This.DS = 'Ad2Win'; //Datasource Name
Request.DS = This.DS;
DS = This.DS;
</cfscript>

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-a31.htm