Do - Loop

The following loop does not have any conditions associated with it.
Caution - This loop will run indefinitely.
This type of loop should be used with extreme caution and should always include at least one Exit Do statement.

Public Sub DoLoop1() 
Dim icount As Integer
   icount = 1
   Do
      If (icount = 5) Then
         Exit Do
      End If
      icount = icount + 1
   Loop
End Sub

Exit Do

The Exit Do statement lets you exit the loop early.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext