Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Truly Random number sequences

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,209
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Truly Random number sequences
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Truly Random number sequences - 6/24/2001 1:16:56 PM   
  GabeWizard

 

Posts: 1
Score: 0
Joined: 6/24/2001
From:
Status: offline
I am very new to VBScript. I got a book about writing "Cool VBScript pages". One of the first things it covers is using the random function. But, when I try it, it gives me the same sequence of random numbers every time. I would like it to give me a truly random set of numbers that is different each time. A game wouldn't be much fun if it "randomly" picked the same numbers every time you played it! How is this done?

Thanks for any info.

Gabe
 
 
Post #: 1
 
 Re: Truly Random number sequences - 6/25/2001 6:51:27 AM   
  buckeye

 

Posts: 1
Score: 0
Joined: 6/25/2001
From:
Status: offline
You should be able to use the Randomize statement to generate your random number sequence, then use the Rnd() function to get the number:

Randomize
dblVal = Rnd()

(in reply to GabeWizard)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Truly Random number sequences Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts