Results 1 to 4 of 4

Thread: Random Number Generator

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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:
    1. Dim rnd As New Random (Form or Global scope NOT local)
    2.  
    3. 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width