Message: 19 Date: Thu, 27 Jan 2005 19:31:39 +1000 From: "D.Rothe" <[EMAIL PROTECTED]> Subject: Random #'s To: <use-revolution@lists.runrev.com> Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1"

Hi All,
I am using the following code to generate a field of 6 random numbers.

repeat 5 times --generate list of 5 random numbers between 1-10
put random(10) & "," after tRnum
end repeat
delete last char of tRnum --delete last comma
put tRnum into fld "numbers"

this works fine but some numbers are repeated in the field, e.g (1,2,3,1,5)
How can I include only unique numbers?

Cheers......Dwayne



Dwayne,

You might try something like:

on mouseUP
  put "" into tList
  repeat until the number of items in tList is 6
    put random(10) into tNum
    if tNum is not in tList then put tNum & ", " after tList
  end repeat
  delete last item of tList
  put tList into fld 1
end mouseUP

Jim


_______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to