Skip to main content
June 29, 2007
Answered

generate list of random numbers

  • June 29, 2007
  • 2 replies
  • 679 views
Hello Everyone,

is it possible to generate a list of random numbers, within a certain range, and without duplicating a number that is allready been used in the list?

tnx for any help...
This topic has been closed for replies.
Correct answer stpaz
Try this ;)

2 replies

Inspiring
June 29, 2007
Yannovich wrote:
> Hello Everyone,
>
> is it possible to generate a list of random numbers, within a certain range, and without duplicating a number that is allready been used in the list?
>
> tnx for any help...

The way I do it...

<cfset list = ''>
<cfloop from="1" to "6" index="i">
<cfset randVal = randomRange(1,10)>

<cfloop contition="listFind(list,randVal)">
<cfset randVal = randomRange(1,10)>
</cfloop>

<cfset list = listAppend(list,randVal)>
</cfloop>
stpazCorrect answer
Participating Frequently
June 29, 2007
Try this ;)
June 29, 2007
Tnx!
dind't know the condition atribute...
Great!