Commenting Code

An important difference to note between ColdFusion's tag-based structure and CFScript is the formation of comments. In the tag-based structure, a comment takes the form <!--- Comment --->, and in CFScript, comments are denoted by a double forward slash (//) . So, use tags like this:

 <!--- This is a comment --->  <cfset foo = 42>  <!--- An additional comment --->  <cfset string_foo = "forty two"> 

And use CFScript like this:

 <!--- This is a comment --->  <cfscript>      foo = 42;      //An additional comment      string_foo = "forty two";  </cfscript> 

Two forward slashes (//) enable the programmer to comment one line only. If a multiple line comment is desired, CFScript provides support for Java, C, and JavaScript-style comment blocks. The block begins with /* and ends with */, as shown in the following code:

 //This is a one-line comment  /*  This is a multiline  comment block  */  

Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579 © 2008-2017.
If you may any questions please contact us: