Results 1 to 2 of 2

Thread: Random numbers.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    Carolina, Puerto Rico, USA
    Posts
    227

    Random numbers.

    Hello.

    Is it possible to get a random number between a given range?, lets say, to get x number, between 1 and 15.

    Thanks in advance.
    NievesJ

  2. #2
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Yes.

    Dim MY_OUT as Integer
    Dim MY_LOW as Integer
    Dim MY_HIGH as Integer

    MY_LOW = 1
    MY_HIGH = 15

    Randomize
    MY_OUT = Int(Rnd * (MY_HIGH - MY_LOW + 1) )+ MY_LOW
    MsgBox MY_OUT

    -Hope this helps
    -Lou
    Last edited by NotLKH; Jul 21st, 2001 at 09:37 AM.

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