|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Look at your Else. You have it as 'eles'...
If (f1 > f2) Then f1 = g3 eles f2 = g3 End If Should be If (f1 > f2) Then f1 = g3 Else f2 = g3 End If |
|
#3
|
|||
|
|||
|
DOH, thanks for the good eeye bud.
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB6 compile error concerning random |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|