hello..can ask about randomize numbers
visual basic
Collapse
X
-
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.)Originally posted by yhenhello..can ask about randomize numbers -
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 vb6Comment
-
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 answerComment
Comment