MACROMEDIA COLFUSION MX 7-CFML Reference page 150

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

Example
The following example uses
delay data display. It simulates a page that is slow to generate data.
<h1>Your Magic numbers</h1>
<p>It will take us a little while to calculate your ten magic numbers. It takes
a lot of work to find numbers that truly fit your personality. So relax for
a minute or so while we do the hard work for you.</p>
<H2>We are sure you will agree it was worth the short wait!</H2>
<cfflush>
<cfflush interval=10>
<!--- Delay Loop to make it seem harder. --->
<cfloop index="randomindex" from="1" to="200000" step="1">
<cfset random=rand()>
</cfloop>
<!--- Now slowly output 10 random numbers. --->
<cfloop index="Myindex" from="1" to="10" step="1">
<cfloop index="randomindex" from="1" to="100000" step="1">
<cfset random=rand()>
</cfloop>
<cfoutput>
Magic number #Myindex# is:&nbsp;&nbsp;#RandRange(
100000, 999999)#<br><br>
</cfoutput>
</cfloop>
150
Chapter 2: ColdFusion Tags
tags and the
cfloop
rand
random number generating function to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents