That's too funny, Karl. I had just sent a note to the list on the RandString
UDF in reply to an earlier note by Mark Handy. Don't want anyone to confuse
the two: Karl's referring to the built-in RandRange function in CF. I can
see that the RandString UDF does not guarantee non-repetition. I'll bet
that's a feature you could easily add to it (using a new argument to request
that characteristic) and contribute it as an update to UDF in the library.
That's what's great about the library.

Though I don't think it suits your needs, I'll point out that there's
another UDF there called MakePassword that "Generates a random 8-character
password that is free of annoying easily confused characters such as 1 or l,
O or 0."  Don't know if that's at all related to the problem you were trying
to avoid/solve, but it's another piece of code that may be worth looking at.

/charlie

> -----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: "charles arehart" <[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)

Reply via email to