[thelist] Random, Not the same Random twice

Russ russ at unrealisticexpectations.com
Sat Mar 20 13:41:28 CST 2004


Good advice; I ended up using CFLOOP to make it work out right.

I'm not sure it's the most efficient, but it's only choosing from around
20 or so records.

Thanks!

Russ

> -----Original Message-----
> From: thelist-bounces at lists.evolt.org 
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Adrian Gonzales
> Sent: Saturday, March 20, 2004 12:35 PM
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] Random, Not the same Random twice
> 
> 
> You could loop the cfif statement. Then if it isnt true, than 
> it breaks
> the loop.
> 
> Oh.. And just so you know... All those pound signs are not 
> neccesary in
> the cfif statements.
> 
> 
> Adrian Gonzales Jr.
> Creative Director
> Clear Span Media
> clearspanmedia.com
> 
> 
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Russ
> Sent: Saturday, March 20, 2004 12:27 PM
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] Random, Not the same Random twice
> 
> 
> I've attempted a couple of things, one being DeleteClientVariable, and
> that's not working.
> 
> In the interim, I've basically built a CFIF that says if Story1 IS
> Story2, get a new random number, but that only repeats itself 
> once.  The
> success ratio is dramatically higher, but it's still not what I need.
> 
> Is there an easier way to this? Certainly it's just my lack of
> experience that's causing me issue here!  I hope!
> 
> > find the fonction in Cold Fusion that allows you to delete 
> a record, 
> > here's a pseudo code : <CFSET Story1 = 
> > #RandRange(1,Stories.recordCount +1)#> <CFSET 
> > Stories.DeleteRecordByValue(Story1) > <CFSET Story2 = 
> > #RandRange(1,Stories.recordCount +1)#> <CFSET 
> > Stories.DeleteRecordByValue(Story2) > <CFSET Story3 = 
> > #RandRange(1,Stories.recordCount +1)#>
> > 
> > each time you select a random value, you delete it from your array 
> > Stories.
> > 
> > 
> > -----Original Message-----
> > And it works great, but I can--and do--get duplicates.  I'm 
> searching 
> > for a resource to disallow Story2 and Story3 from getting the same 
> > variable as Story1, but I'm drawing a blank.
> > 
> > Can someone point me in the right direction?
> > 
> 
> 
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 
> -- 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 




More information about the thelist mailing list