Collabora Office 24.04 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 ๋ฌธ ๋ด์์๋ง ์ ํจํ๋ฉฐ ๋ฃจํ๋ฅผ ์ข ๋ฃํฉ๋๋ค. Loop ๋ฌธ ๋ค์ ์ค๋ ๋ฌธ์์ ํ๋ก๊ทธ๋จ ์คํ์ด ๊ณ์๋ฉ๋๋ค. Do...Loop ๋ฌธ์ด ์ค์ฒฉ๋ ๊ฒฝ์ฐ ์ฝํธ๋กค์ด ๋ค์ ์์ ์์ค์ ๋ฃจํ๋ก ์ด๋ํฉ๋๋ค.
Exit For
For...Next ๋ฃจํ ๋ด์์๋ง ์ ํจํ๋ฉฐ ๋ฃจํ๋ฅผ ์ข ๋ฃํฉ๋๋ค. Next ๋ฌธ ๋ค์์ ์ค๋ ์ฒซ ๋ฒ์งธ ๋ฌธ์์ ํ๋ก๊ทธ๋จ์ด ์คํ์ด ๊ณ์๋ฉ๋๋ค. ์ค์ฒฉ๋ ๋ฌธ์์๋ ์ ์ด๊ฐ ๋ค์ ์์ ์์ค์ ๋ฃจํ๋ก ์ด๋ํฉ๋๋ค.
Exit Function
Function ํ๋ก์์ ๋ฅผ ์ฆ์ ์ข ๋ฃํฉ๋๋ค. Function ํธ์ถ ๋ค์ ์ค๋ ๋ฌธ์์ ํ๋ก๊ทธ๋จ ์คํ์ด ๊ณ์๋ฉ๋๋ค.
Exit Property
Exits the Property procedure immediately. Program execution continues with the statement that follows the Property call.
Exit Sub
์๋ธ๋ฃจํด์ ์ฆ์ ์ข ๋ฃํฉ๋๋ค. 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 Returns the index of the entry or 0 ( Null)
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