SunQuest
 
       ColdFusion
  Home arrow ColdFusion arrow Page 4 - Everything You Must Know About ColdFusion ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
COLDFUSION

Everything You Must Know About ColdFusion Variables
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 4
    2005-08-15

    Table of Contents:
  • Everything You Must Know About ColdFusion Variables
  • Developing ColdFusion Content
  • Variable definition with CFSET tag
  • Variable by assigning statements in CFSCRIPT
  • Scope of a variable
  • Data Type Category of Variables
  • How do we name a variable?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Everything You Must Know About ColdFusion Variables - Variable by assigning statements in CFSCRIPT


    (Page 4 of 7 )

    It was mentioned earlier that CFSCRIPT can be used to assign variables. Here is an example of such an assignment. In CSPT.cfm, three numbers are assigned to the variables m, n, and p. There are rules to be followed in using CFSCRIPT, but these will be discussed later. Notice the ColdFusion comment. It has an extra dash, three compared to two in an HTML comment.

    Syntax
    <CFSCRIPT>
    The CFSCRIPT code goes here, review the example
    </CFSCRIPT>
    <!--- Usage of CFSCRIPT--->
    <!---File Name:CSPT.cfm--->
    <cfscript>
    m=5;
    n=1.5;
    p=2;
    WriteOutput("The value of (5 + 1.5) divided by 2 is: ");
    WriteOutput((n+m)/p);
    </cfscript>
    

    This code will be processed by the CFMX as shown in this picture. CFSCRIPT is only processed by the server. It may not contain CFML tags, and statements are terminated by a semicolon (similar to JavaScript). The same assignment with CFML would have taken three <cfset /> tags plus the <cfoutput />. The display in CFSCRIPT is by using the WriteOutput() syntax. You may also notice the absence of CFML tags inside <cfscript />

    Characteristics of Variables

    Variables in ColdFusion are characterized by the following:

    • Scope of the variable -- This covers where and how long the variable is accessible.
    • Data type of the variable -- This covers the kind of information that the variable represents, number, strings, Boolean, and so on.

    More ColdFusion Articles
    More By Jayaram Krishnaswamy


       · I very much would like to have your comments on this article. [b]Macromedia[/b] has...
     

    COLDFUSION ARTICLES

    - How to Access a SQL Anywhere Database with C...
    - CFXML: Probing XMLDOM in ColdFusion
    - Creating a Web Service with ColdFusion: the ...
    - CFAjax: What it is and How to Use it
    - Querying SQL 2000 Server from ColdFusion
    - Introduction to ColdFusion Markup Language, ...
    - Introduction to ColdFusion Markup Language
    - Databases and Dreamweaver MX 2004, concluded
    - Databases and Dreamweaver MX 2004
    - Welcome to Coldfusion MX 6.1, concluded
    - Welcome to Coldfusion MX 6.1
    - What You Must Know About ColdFusion Flow-Con...
    - What You Must Know About Operators in ColdFu...
    - Everything You Must Know About ColdFusion Va...
    - My First Application on ColdFusion MX Server







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway