LibreOffice 24.8 Help
Exits a Do...Loop, For...Next, a function, a property, or a subroutine.
Exit Do, Exit For, Exit Function, Exit Property, Exit Sub
Exit Do
āĻ˛ā§āĻĒ āĻĨā§āĻā§ āĻĒā§āĻ°āĻ¸ā§āĻĨāĻžāĻ¨ āĻāĻ°āĻžāĻ° āĻāĻ¨ā§āĻ¯ āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° Do...Loop āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻāĻĒāĻ¸ā§āĻĨāĻŋāĻ¤ āĻĨāĻžāĻāĻž āĻŦā§āĻ§āĨ¤ āĻĒā§āĻ°ā§āĻā§āĻ°āĻžāĻŽ āĻāĻžāĻ˛āĻ¨āĻž āĻ¸ā§āĻā§āĻŽā§āĻ¨ā§āĻā§āĻ° āĻ¸āĻžāĻĨā§ āĻŦāĻšāĻžāĻ˛ āĻĨāĻžāĻā§ āĻ¯āĻž āĻ˛ā§āĻĒ āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻ āĻ āĻ¨ā§āĻ¸āĻ°āĻŖ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ Do...Loop āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻāĻāĻŋ āĻāĻāĻ¤ā§āĻ°āĻŋāĻ¤ āĻĨāĻžāĻā§, āĻ¤āĻžāĻšāĻ˛ā§ āĻāĻ¨ā§āĻā§āĻ°ā§āĻ˛āĻāĻŋ āĻĒāĻ°āĻŦāĻ°ā§āĻ¤ā§ āĻāĻā§āĻāĻ¤āĻ° āĻ¸ā§āĻ¤āĻ°ā§āĻ° āĻ˛ā§āĻĒā§ āĻ¸ā§āĻĨāĻžāĻ¨āĻžāĻ¨ā§āĻ¤āĻ°āĻŋāĻ¤ āĻšā§ā§ āĻĨāĻžāĻā§āĨ¤
Exit For
āĻ˛ā§āĻĒ āĻĨā§āĻā§ āĻĒā§āĻ°āĻ¸ā§āĻĨāĻžāĻ¨ āĻāĻ°āĻžāĻ° āĻāĻ¨ā§āĻ¯ āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° For...Next āĻ˛ā§āĻĒā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻŦā§āĻ§āĨ¤ āĻĒā§āĻ°ā§āĻā§āĻ°āĻžāĻŽ āĻāĻžāĻ˛āĻ¨āĻž āĻĒā§āĻ°āĻĨāĻŽ āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻ āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻšāĻžāĻ˛ āĻĨāĻžāĻā§ āĻ¯āĻž Next āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻāĻāĻŋ āĻ āĻ¨ā§āĻ¸āĻ°āĻŖ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻ¨ā§āĻ¸ā§āĻā§āĻĄ āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻā§āĻ° āĻŽāĻ§ā§āĻ¯ā§, āĻāĻ¨ā§āĻā§āĻ°ā§āĻ˛āĻāĻŋ āĻĒāĻ°āĻŦāĻ°ā§āĻ¤ā§ āĻāĻā§āĻāĻ¤āĻ° āĻ¸ā§āĻĨāĻ°ā§āĻ° āĻ˛ā§āĻĒā§ āĻ¸ā§āĻĨāĻžāĻ¨āĻžāĻ¨ā§āĻ¤āĻ°āĻŋāĻ¤ āĻšā§āĨ¤
Exit Function
āĻ āĻŦāĻŋāĻ˛āĻŽā§āĻŦā§ āĻĢāĻžāĻāĻļāĻ¨ āĻĒā§āĻ°āĻ¸āĻŋāĻāĻžāĻ° āĻĨā§āĻā§ āĻĒā§āĻ°āĻ¸ā§āĻĨāĻžāĻ¨ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻĒā§āĻ°ā§āĻā§āĻ°āĻžāĻŽ āĻāĻžāĻ˛āĻ¨āĻž āĻ¨āĻŋāĻā§āĻ° āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻā§āĻ° āĻ¸āĻžāĻšāĻžāĻ¯ā§āĻ¯ā§ āĻŦāĻšāĻžāĻ˛ āĻĨāĻžāĻā§ āĻ¯āĻž āĻĢāĻžāĻāĻļāĻ¨ āĻāĻ˛ āĻ āĻ¨ā§āĻŦāĻ°ā§āĻ¤ā§āĨ¤
Exit Property
Exits the Property procedure immediately. Program execution continues with the statement that follows the Property call.
Exit Sub
āĻ āĻŦāĻŋāĻ˛āĻŽā§āĻŦā§ āĻ¸āĻžāĻŦāĻ°ā§āĻāĻŋāĻ¨ āĻĨā§āĻā§ āĻĒā§āĻ°āĻ¸ā§āĻĨāĻžāĻ¨ āĻāĻ°ā§ āĻĨāĻžāĻā§āĨ¤ āĻĒā§āĻ°ā§āĻā§āĻ°āĻžāĻŽ āĻāĻžāĻ˛āĻ¨āĻž āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻ āĻ¸āĻš āĻŦāĻšāĻžāĻ˛ āĻĨāĻžāĻā§ āĻ¯āĻž āĻ¸āĻžāĻŦ āĻāĻ˛ āĻ āĻ¨ā§āĻŦāĻ°ā§āĻ¤ā§āĨ¤
Exit āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻāĻāĻŋ āĻāĻžāĻ āĻžāĻŽā§āĻ° āĻļā§āĻˇ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŖ āĻāĻ°ā§ āĻ¨āĻž, āĻāĻŦāĻ āĻ āĻŦāĻļā§āĻ¯āĻ End āĻ¸ā§āĻā§āĻāĻŽā§āĻ¨ā§āĻ āĻāĻ° āĻ¸āĻžāĻĨā§ āĻā§āĻ˛āĻŋā§ā§ āĻĢā§āĻ˛āĻž āĻ¯āĻžāĻŦā§ āĻ¨āĻžāĨ¤
Sub ExampleExit
Dim sReturn As String
Dim sListArray(10) As String
Dim siStep As Single
For siStep = 0 to 10 REM Fill array with test data
sListArray(siStep) = chr(siStep + 65)
MsgBox sListArray(siStep)
Next siStep
sReturn = LinSearch(sListArray(), "B")
Print sReturn
End Sub
Function LinSearch( sList(), sItem As String ) As Integer
Dim iCount As Integer
REM LinSearch searches a TextArray:sList() for a TextEntry:
REM āĻā§āĻā§āĻ¤āĻŋāĻ° āĻāĻ¨āĻĄā§āĻā§āĻ¸ āĻ
āĻĨāĻŦāĻž ā§Ļ (āĻ¨āĻžāĻ˛) āĻĒā§āĻ°āĻĻāĻžāĻ¨ āĻāĻ°ā§
For iCount=1 To Ubound( sList() )
If sList( iCount ) = sItem Then
Exit for REM sItem found
End If
Next iCount
If iCount = Ubound( sList() ) Then iCount = 0
LinSearch = iCount
End Function