MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 78

Table of Contents

Advertisement

58
Reviewing the code
The following table describes the code and its function:
Code
<H2>We are sure you will agree it was
<cfflush>
<cfflush interval=10>
<cfloop index="randomindex" from="1"
</cfloop
<cfloop index="Myindex" from="1"
</cfloop>
worth the short wait!</H2>
to="200000" step="1">
<cfset random=Rand()>
>
to="10" step="1">
<cfloop index="randomindex"
from="1" to="100000" step="1">
<cfset random=rand()>
</cfloop>
<cfoutput>
Magic number number #Myindex#
is:&nbsp;&nbsp;#RandRange
(100000,999999)#<br><br>
</cfoutput>
Chapter 4 Retrieving and Formatting Data
Description
Send the HTML header and all HTML
output to the
cfflush
This displays the explanatory paragraph
and H2 tag contents.
Flush additional data to the user every
time at least ten bytes are available.
Insert an artificial delay by using the
function to calculate many random
Rand
numbers.
Generate and display ten random
numbers. This code uses two loops. The
outer loop is repeated ten times, once for
each number to display. The inner loop
uses the
rand
function to create another
delay by generating more (unused)
random numbers. It then calls the
function to generate a
RandRange
six-digit random number for display.
tag to the user.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents