On 3/13/06, liamlambert <[EMAIL PROTECTED]> wrote: > I have this code for a random number in 6 > fld's how do I stop the same number form appearing > in more then one fld > > put "1a,2a,3a,4a,5a,6a" into tFieldNames > repeat for each item tfield in tFieldNames > put the random of 45 into trandom > put trandom into fld tfield > end repeat >
This is the sort of question that always produces lots of methods, but here's one possibility: -- build a list of the numbers from 1 to 45 put empty into tNumberList repeat with x = 1 to 45 put x & cr after tNumberList end repeat -- sort this list randomly sort lines of tNumberList by random(10000) -- use the first 6 numbers to fill your fields put "1a,2a,3a,4a,5a,6a" into tFieldNames repeat for each item tfield in tFieldNames put line 1 of tNumberList into fld tfield delete line 1 of tNumberList end repeat Cheers, Sarah _______________________________________________ use-revolution mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
