10 replies
by ser710 Accepted solution
by tony hopkinson Accepted solution
it returns a float >=0 <=1
textbox1.text = cStr(Trunc(Rnd() * 11))
if my spotty memory of VB6 serves me correctly.
by rwidegren Accepted solution
The Randomize function seeds the rnd() function with the timer (if no other parameter is specified). You need to "re-seed" each time or you'll get the same sequence of numbers. Then you use the next statement to generate the random number - setting the upper and lower limits.
Dim iRand As Integer
Randomize
nRand = Int((MaxNum - MinNum + 1) * Rnd + MinNum)
by tony hopkinson Accepted solution
by aikimark Accepted solution
There are some limitations on the VB pseudo-random number generation (PRNG) functions. I wrote the following article when one of my applications encountered a problem stemming from this limitation.
by tony hopkinson Accepted solution
I've been aware that random wasn't random for along time. Seeing as it's an abstract mathematical concept with no real world equivalent. Chaos theory crapped on the entire idea.
I didn't know there was a specific weakness in the VB implementation though, can't say it's a surprise mind.
by aikimark Accepted solution
Since 15seconds.com has gone dark, I've republished the article here:
http://www.experts-exchange.com/A_11114.html
by t.bradford Accepted solution
by tony hopkinson Accepted solution
by mahalakshmi Accepted solution
dim max,min
max=100
min=1
Text1.Text = (Int((max - min + 1) * Rnd + min))
Output:
71
This discussion is closed to new replies.
Trending Software posts
Sort by Trending