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.
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.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.