Exit
The Exit statement is used to exit a function, do loop or
subroutine when placed inside the specified control object. You
would normally execute this statement conditionally based on a
condition.
The Exit statement acts on the nearest enclosing function
or subroutine in which it is found. For instance, if you have
nexted do loops, the Exit Do statement would only exit the
innermost loop.
Dim I, J
' here is an example of Exit Do
I = 0 : J = 2 Do While I < 3 If I + J > 5 Then Exit Do I = I + 1 Loop
' and here is an example of Exit Function
Function locTest(sParam) If sParam = "" Then Exit Function Response.Write "Hi! My name is " & sParam locTest = True End Function
' and here is an example of Exit Sub
Sub locTest2(sParam) If sParam = "" Then Exit Sub Response.Write "Hi! My name is " & sParam End Sub
|
 |

|