Results 1 to 2 of 2

Thread: Randomize

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Sorry, I forgot the randomize code...can someone post it?

    Thanks A Bunch

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    derby,UK
    Posts
    38

    Lottery

    copy this code into the form_Load() event to generate random numbers.
    ------------------------------------------------------------
    Private Sub Form_Load()

    Dim nRandom() as Integer
    Dim nLoopCounter as Integer
    Dim nArraySize as Integer

    Form1.Show

    Randomize
    nArraySize =Int(Rnd(1) * 10)
    ReDim nRandom(nArraySize)

    For nLoopCounter = 1 to nArraySize
    nRandom(nLoopcounter) = Int(Rnd(1) *49)
    Form1.Print "Lottery Number "& nLoopcounter & " = "&
    --> nRandoms(nLoopCounter)
    Next

    End Sub
    ------------------------------------------------------------
    DOes this help? just remember that the Rnd and the Randomize are the main radomizers (no API)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width