• Visual Basic 
    Public Function get_random(ByVal max As Long, ByVal min As Long) As Long

       Randomize Timer
       get_random = Int(((max + 1) * Rnd) + (min + 1)) - 1

    End Function

  • Visual Basic .net
    Public Function get_random_min_max(ByVal min As Int16, ByVal max As Int16) As Int16
    Try
      Dim rnd As Random = New Random
      Return rnd.Next( min , max )
    Catch ex As Exception
      MessageBox.Show(ex.Message, "GenerateRndNumber")
     End Try
    End Function
Tags
Comments
Write the first comment
Leave a trace
Name *
Email *
Website
Anti SPAM * Code (7 + 2) =
Leave me a comment *
 
All comments are subject to editorial review
Post being viewed right now
Item date: 01.01.2009
Views: 1876
Item date: 04.02.2009
Views: 843
Item date: 12.04.2009
Views: 1738
Item date: 10.04.2009
Views: 1513
Item date: 23.08.2009
Views: 290
Item date: 10.04.2009
Views: 1121
Item date: 01.01.2009
Views: 634
Item date: 01.03.2010
Views: 1250
Item date: 19.07.2009
Views: 1290