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 ដើម្បីចេញពីរង្វិលជុំ ។ ការប្រតិបត្តិកម្មវិធីបន្តជាមួយសេចក្តីថ្លែងការណ៍ដែលនៅបន្តពីសេចក្តីថ្លែងការណ៍ 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
ចេញពីទម្រង់ការរងភ្លាមៗ ។ ដំណើរការប្រតិបត្តិកម្មវិធីបន្តជាមួយសេចក្តីថ្លែងការណ៍ ដែលនៅបន្តពីការហៅ 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