
February 8th, 2004, 12:12 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
VB6 compile error concerning random
I am tring to create a program that will generate 4 random numbers between 1 and 20 adding the highest three and adding 35 to the final value.
For some reason when I try to compile the program I get the following warning: Sub or Function undefined.
I would appreciate any help.
Code:
Private Sub strr_Click()
Randomize Timer
Text1.Text = Int(Rnd * 20) + 1
Text2.Text = Int(Rnd * 20) + 1
Text3.Text = Int(Rnd * 20) + 1
Text4.Text = Int(Rnd * 20) + 1
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
If (a > b) Then a = g1 & b = f1
eles b = g1 & a = f1
End If
If (c > d) Then c = g2 & d = f2
eles d = g2 & c = f2
End If
If (f1 > f2) Then f1 = g3
eles f2 = g3
End If
|