How do i generate random numbers in visual basic?
-
ok so i took a vb class and they gave an example. They somehow declared (something) as new random and then like i could put into my code: "(integer) = (something).next(#, #)" and it would generate a random number between # and #. right now my sintax is not correct because i have: "Dim find as new random" and then "book = find.next(1, 67)" and while i should get a random number >= 1 and < 67 for whatever reason i am not getting any number whatsoever. If someone could help me use the predefined random function in visual studio 2008 express edition that would be really helpful. thanks!
-
Answer:
Try putting the starting and ending random number in seperate ();
Jake at Yahoo! Answers Visit the source
Other answers
Try Dim Rand As Integer Rand = Int((High - Low + 1) * Rnd) + Low (Where High and Low are your limits)
Related Q & A:
- how to generate random isotropic vectors using R?Best solution by Stack Overflow
- How do I generate documentation for a project?Best solution by Stack Overflow
- How to generate random number each time?Best solution by Stack Overflow
- How do I generate barcode using c#?Best solution by Stack Overflow
- How do I output from one form to another in Visual Basic?Best solution by support.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.