G
Guest
Can somebody help me out? I need the code to generate a random number between
1 and 100.
1 and 100.
Efrain said:Can somebody help me out? I need the code to generate a random number
between
1 and 100.
Scott M. said:Dim randValue As Integer
Dim x As New Random
randValue = x.Next(1001)
The documentation on the Next method does not state the very important fact
that the value you pass as the maximum value the random class should return
(in this case 1001) is never reached. So, if you want to potentially get
back 1000, you must enter 1001.