Home  |  Latest News  |  Contribute  |  F.A.Q.  |  Account  |  Scripts | About
Search ASPNut:
 
ASP Reference
Server Variables
ASP Glossary
Related Sites

Free Components

HTML Reference
Web Colors
Entities
CSS Level 1
Encode/Decode
Glossary

Our Sponsors
ASP Nuke CMS
Free Auctions
PHP 5 Script
Funktastic Blog
ULost Directory
Team Task

 

 

 

 

 

 

 

 

 

 

 

 

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

Orvado Technologies

ASP Nuke CMS
Free Open Source
Content Manager
HomeFix Boards
Home Remodeling
Message Boards

Contact Us | Contribute | About | Site Map



"Democracy consists of choosing your dictators, after they've told you what it is you want to hear." - Alan Coren

©2007 Orvado Technologies, All Rights Reserved
ASP Nut provides articles and reference documentation for Active Server Page developers.