Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuing a loop in VB without Goto statement

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

Private Sub Command1_Click()
Dim i As Integer

Do While i < 10
If i = 5 Then
i = i + 1
(????????)
End If
print i
i = i + 1
loop
End Sub


In the above code I don't want to print value if i = 5. I should achieve this without a GOTO statement.

Any suggestions pls.

Thanks in advance
 
Private Sub Command1_Click()
Dim i As Integer

Do While i < 10
If i <> 5 Then
print i
end if
i = i + 1
loop
End Sub


David Paulson

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top