visual basic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yhen
    New Member
    • Sep 2007
    • 1

    #1

    visual basic

    hello..can ask about randomize numbers
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by yhen
    hello..can ask about randomize numbers
    Sure, go ahead and ask your question. What do you want to know? (Also, tell us what version of VB you're using, because generating random numbers is done a bit differently in different versions.)

    Comment

    • metalheadstorm
      New Member
      • Sep 2007
      • 84

      #3
      i know u havent even posted a question yet but i read this and thought of a small learner program i did @ college ther someof the code

      Randomize
      counter = Int(Rnd * 9) + 1

      i dunno if this help what so ever

      but it randomizes numbers between 1and 9, but being a computer it will always show the same order of random numbers so thats why u randomize it again :D
      Using vb6

      Comment

      • Sunray
        New Member
        • Jul 2007
        • 12

        #4
        I Use This Type Of Randomization Quite A Lot
        Hope Its What You Were Looking for

        Private Sub Command1_Click( )
        Dim a As Integer
        a = 1 + Int(Rnd * 100)
        Label1.Caption = a
        End Sub

        You Can Even Take It Futher
        Private Sub Command1_Click( )
        Dim a,b,c As Integer
        a = 1 + Int(Rnd * 100)
        b = 1 + Int(Rnd*100)
        c = a + b
        Label1.Caption = a
        Label2.Caption = b
        Label3.Caption = c
        End Sub

        This merely adds up the two random numbers and give you thier answer

        Comment

        Working...