Any help would be appreciated here...

In the end, I would like 4 dynamically named variables with
random values. What am I missing?

<cfscript>
// Convert the product ids to a comma delimited list.
PIDList = ValueList(getAllInCat.Product_ID);

// Loop through 4 times and create 4 dynamically name vars with random
values.
for(i=1; i LTE 4; i = i + 1)
{
// Grab a random number based on the number of products available.
RandValue#i# = RandRange(1, ListLen(PIDList));
// Get the Product_ID based on the random number.
RandRecord#i# = ListGetAt(PIDList, RandValue#i#);
// Remove the first Random value from the list, so it is not selected
twice.
PIDList = ListDeleteAt(PIDList, RandValue#i#);
}
</cfscript>

Thanks, Ché

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to