You could store randRange results in a list and do something like
while ( listFind( randRangeResultList, n ) ) {
n = RandRange( 1, myquery.RecordCount );
}
That in worst case could slow down your app though.
A little more insight into what you want to achieve might help us provide
you with more help.
Marc
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Karl Zarudny
> Sent: Thursday, March 28, 2002 11:12 AM
> To: CFUG
> Subject: [CFTALKTor] RandRange question - Unique random numbers
>
>
> Hi everybody.
>
> I'm using RandRange to generate random numbers within a cfoutput.
> How can I
> ensure that there is no repetition? Here's what I'm doing:
>
> <cfoutput query="myquery">
> <cfset n = #RandRange(1,myquery.RecordCount)#>
> <img src="img#n#.gif" alt="Image #n#">
> </cfoutput>
>
> Should I be using something else instead?
>
> Thanks,
> Karl
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: Karl Zarudny <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>
>
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)