realbasic-nug
[Top] [All Lists]

Re: Checking array for double entries

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Checking array for double entries
From: "Steve Garman" <realbasic@garman.demon.co.uk >
Date: Sat, 28 Jun 2008 21:04:24 +0100
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <233017.99162.qm@web28006.mail.ukl.yahoo.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
When I want to do something like this, I just create a list of all the
possible numbers and shuffle them.

I then take the first six numbers from the shuffled list.

Something like

  dim nums(69) as Integer
  dim i as Integer
  dim x(5) as Integer
  
  for i = 0 to 69
    nums(i) = i + 1
  next
  nums.Shuffle
  
  for i = 0 to 5
    x(i) = nums(i)
  next
 
-- 
Steve Garman
Using RB2008r2 Professional on Windows Vista Ultimate



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>