Macromedia coldfusion 4.5-cfml language reference ユーザーズマニュアル

ページ / 608
10
CFML Language Reference 
<P> The value of myVariable after incrementing through the loop
#Counter# times is: #myVariable#
</CFOUTPUT>
<!--- reset the variable and show the use of CFABORT --->
<H3>Example B: Use CFABORT to halt the instruction</H3>
<CFSET myVariable = 3>
<!--- now, perform a loop that increments this value --->
<CFLOOP FROM="1" TO="4" INDEX="Counter">
<!--- on the second time through the loop, CFABORT --->
<CFIF Counter is 2>
<CFABORT>
<!--- the processing is stopped, and subsequent operations
are not carried out by the CFAS --->
<CFELSE>
<CFSET myVariable = myVariable + 1>
</CFIF>
</CFLOOP>
<CFOUTPUT>
<P> The value of myVariable after incrementing through the loop
#counter# times is: #myVariable#
</CFOUTPUT>
</BODY>
</HTML>