Chapter 1: ColdFusion Tags
</CFLOCK>
<!---------------------------------------------------------------------
Use the application lock for the application variable. This
variable keeps track of the total number of turtlenecks sold. The
application lock should have the same name as specified in the
CFAPPLICATION tag.
----------------------------------------------------------------------->
<CFLOCK SCOPE="Application" Timeout="30" Type="Exclusive">
</CFLOCK>
<CFLOCK SCOPE="Application" TIMEOUT="30" TYPE="ReadOnly">
</CFLOCK>
<!----------------------------------------------------------------------
End of Application.cfm
------------------------------------------------------------------------>
<HEAD>
<TITLE>
CFLOCK Example
</TITLE>
</HEAD>
<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY
<H3>CFLOCK Example</H3>
<CFIF IsDefined("form.submit")>
<CFOUTPUT>
</CFOUTPUT>
<!-----------------------------------------------------------------
Lock session variables to assign form values to them.
------------------------------------------------------------------->
<CFLOCK SCOPE="Session" TIMEOUT="30" TYPE="Exclusive">
</CFLOCK>
<!------------------------------------------------------------------
Lock application variable application.number to find the total number
of turtlenecks sold.
------------------------------------------------------------------->
<CFIF NOT IsDefined("session.color")>
<CFSET session.color = "">
</CFIF>
<CFIF NOT IsDefined("application.number")>
<CFSET application.number = 1>
</CFIF>
<CFOUTPUT>
E-Turtleneck is proud to say that we have sold
#application.number# turtlenecks to date.
</CFOUTPUT>
bgcolor="#FFFFD5">
Thank you for shopping E-Turtleneck. Today you have
chosen a turtleneck in size <b>#form.size#</b> and in the color
<b>#form.color#</b>.
<CFPARAM NAME=session.size Default=#form.size#>
<CFPARAM NAME=session.color Default=#form.color#>
127
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