I think this is what you were asking for
<cfscript>
list="John,Paul,Ringo,George";
for(x=listLen(list); x gte 1; x=x-1){
theone = randrange(1,x);
writeOutput( getToken(list,theone,',') );
list = listDeleteAt(list,theone,',');
}
</cfscript>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:coldfusion.developer@;att.net]
Sent: Friday, November 15, 2002 11:19 AM
To: CF-Talk
Subject: Ramdomizing elements in a LIST
I'm trying to randomize the output of a list within a CFLOOP. Any help
would
be great. Her's what I have so far.
<cfloop INDEX="ListElement" LIST="John,Paul,Ringo,George">
<CFOUTPUT>#ListElement#</CFOUTPUT><BR>
</cfloop>
D
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.