OK I Fixed the NON 6digit
:D I've fixed the Non 6 Digit problem...
Private Sub co_Click()
Dim thenum As Long
Dim therot As Long
Randomize
thenum = "999999" 'This will generate numbers from 1 - 999999
therot = Int((thenum * Rnd) + 1)
l.Caption = therot
If therot > "100000" And therot = "889499" Then
o = "You've won the Lottery! here's 1 million for prog_tom..."
Open "c:\ot.txt" For Append As #2
Print #2, "============"
Print #2, l.Caption
Print #2, o.Caption
Print #2, "==============="
Close #2
ElseIf therot < "1000" Then
o = "Not ENOUGH NUMBERS"
Else
o = "Sorry you lost, but still 1 million for prog_tom!"
Open "c:\ot.txt" For Append As #2
Print #2, "============"
Print #2, l.Caption
Print #2, o.Caption
Print #2, "==============="
Close #2
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
co_Click
Else
End If
End Sub
Private Sub Form_Load()
Me.Move -Me.Width + Screen.Width, -Me.Height + Screen.Height + (-400)
Do Until l.Caption = "889499"
co_Click
Loop
Shell "notepad.exe " & "c:\ot.txt", vbNormalFocus
Kill ("c:\ot.txt")
End Sub
I waited so long to Generate it around 5 minutes!!!