-
Feb 20th, 2005, 08:55 PM
#1
Thread Starter
PowerPoster
Random Number Generator
There seems to be no documentation on how to generate random numbers as easily as in VB6. The following generates a different sequence of number(s) in the range 0 to 45 each time it is invoked, even if the project is re-started (which is where several generators fall down).
VB Code:
Dim rnd As New Random (Form or Global scope NOT local)
TextBox1.Text = rnd.Next(45).ToString
Last edited by taxes; Aug 30th, 2005 at 05:29 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Apr 20th, 2005, 09:29 AM
#2
Re: Random Number Generator
Originally Posted by taxes
There seems to be no documentation on how to generate random numbers as easily as in VB6.
The System.Random class seems well documented to me. What's your exact problem?
-
Apr 20th, 2005, 02:06 PM
#3
Re: Random Number Generator
Originally Posted by ntg
The System.Random class seems well documented to me. What's your exact problem?
I was thinking the same. Anyway I had this covered in this thread...
http://www.vbforums.com/showthread.php?t=332527
Last edited by wossname; Apr 20th, 2005 at 02:15 PM.
-
Apr 20th, 2005, 04:51 PM
#4
Thread Starter
PowerPoster
Re: Random Number Generator
Originally Posted by ntg
The System.Random class seems well documented to me. What's your exact problem?
I have no problem with it. This is not a problem post. I put this in the code bank because there are dozens of posts on the subject, most of which end up NOT generating random numbers at all. Look some of them up and you will see what I mean. It may be easy to you but it obviously isn't to many others. We should not really be having this discussion in the codebank section. Either start a new thread or use the private message system.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|