Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Truly random numbers?

Author
Message
hyperstork
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location:
Posted: 19th Jan 2003 23:45
Hmm... I've used the randomize command, but the random numbers I call for are exactly the same every time I run my program. Any pointers on getting truly random numbers without having to manually edit your randomize seed number every time you run the code?
Thanks...
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 19th Jan 2003 23:49
Use Randomize Timer()

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
hyperstork
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location:
Posted: 22nd Jan 2003 11:11
Okay, I tried that randomize timer and it didn't make it more random. I couldn't find that command in the help section. Any hints on usage, code examples? This is a real show-stopper for me. :/

Hubdule
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 22nd Jan 2003 11:26
Test this code ... then you'll see how it works:



If you change the Randomize timer() to Randomize 100 then the Random Seed is everytime the same and you'll get the same numbers all the time ... the timer() changes all the time so it's some sort of random because this variable changes all the time and so the Random Seed.

ShockFire
21
Years of Service
User Offline
Joined: 18th Jan 2003
Location: United Kingdom
Posted: 22nd Jan 2003 22:02
the reason you cant find it in your manual is that it's two commands.
1: randomize
2: timer()

you should be able to find both of them seperately in your manual, read em both and it should help you understand whats going on

Login to post a reply

Server time is: 2024-11-23 21:59:13
Your offset time is: 2024-11-23 21:59:13