summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/shared/03090412.xhp
diff options
context:
space:
mode:
Diffstat (limited to 'helpcontent2/source/text/sbasic/shared/03090412.xhp')
-rw-r--r--helpcontent2/source/text/sbasic/shared/03090412.xhp87
1 files changed, 87 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/shared/03090412.xhp b/helpcontent2/source/text/sbasic/shared/03090412.xhp
new file mode 100644
index 000000000..adad55212
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/shared/03090412.xhp
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+
+<meta>
+ <topic id="textsbasicshared03090412xml" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Exit Statement</title>
+ <filename>/text/sbasic/shared/03090412.xhp</filename>
+ </topic>
+</meta>
+
+<body>
+
+
+<section id="exit">
+<bookmark xml-lang="en-US" branch="index" id="bm_id3152924">
+ <bookmark_value>Exit statement</bookmark_value>
+</bookmark>
+
+
+<h1 id="hd_id3152924"><link href="text/sbasic/shared/03090412.xhp" name="Exit Statement">Exit Statement</link></h1>
+<paragraph id="par_id3153394" role="paragraph" xml-lang="en-US">Exits a <emph>Do...Loop</emph>, <emph>For...Next</emph>, a function, a property, or a subroutine.</paragraph>
+</section>
+
+<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
+<bascode>
+<paragraph id="par_id3159157" role="bascode" xml-lang="en-US">Exit Do, Exit For, Exit Function, Exit Property, Exit Sub</paragraph>
+</bascode>
+
+<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
+<paragraph id="par_id3154760" role="paragraph" xml-lang="en-US" localize="false"> <emph>Exit Do</emph> </paragraph>
+<paragraph id="par_id3147559" role="paragraph" xml-lang="en-US">Only valid within a <emph>Do...Loop</emph> statement to exit the loop. Program execution continues with the statement that follows the Loop statement. If <emph>Do...Loop</emph> statements are nested, the control is transferred to the loop in the next higher level.</paragraph>
+<paragraph id="par_id3150398" role="paragraph" xml-lang="en-US" localize="false"> <emph>Exit For</emph> </paragraph>
+<paragraph id="par_id3148797" role="paragraph" xml-lang="en-US">Only valid within a <emph>For...Next</emph> loop to exit the loop. Program execution continues with the first statement that follows the <emph>Next</emph> statement. In nested statements, the control is transferred to the loop in the next higher level.</paragraph>
+<paragraph id="par_id3147229" role="paragraph" xml-lang="en-US" localize="false"> <emph>Exit Function</emph> </paragraph>
+<paragraph id="par_id3154685" role="paragraph" xml-lang="en-US">Exits the <emph>Function</emph> procedure immediately. Program execution continues with the statement that follows the <emph>Function</emph> call.</paragraph>
+<paragraph id="par_id31581260355116" role="paragraph" xml-lang="en-US" localize="false"> <emph>Exit Property</emph> </paragraph>
+<paragraph id="par_id1001581260355700" role="paragraph" xml-lang="en-US">Exits the <emph>Property</emph> procedure immediately. Program execution continues with the statement that follows the <emph>Property</emph> call.</paragraph>
+<paragraph id="par_id3155132" role="paragraph" xml-lang="en-US" localize="false"> <emph>Exit Sub</emph> </paragraph>
+<paragraph id="par_id3149561" role="paragraph" xml-lang="en-US">Exits the subroutine immediately. Program execution continues with the statement that follows the <emph>Sub</emph> call.</paragraph>
+<paragraph id="par_id3153143" role="note" xml-lang="en-US">The Exit statement does not define the end of a structure, and must not be confused with the End statement.</paragraph>
+
+<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
+<bascode>
+<paragraph id="par_idm1341018896" role="bascode" localize="false" xml-lang="en-US">Sub ExampleExit</paragraph>
+<paragraph id="par_idm1341017664" role="bascode" localize="false" xml-lang="en-US">Dim sReturn As String</paragraph>
+<paragraph id="par_idm1341016432" role="bascode" localize="false" xml-lang="en-US">Dim sListArray(10) As String</paragraph>
+<paragraph id="par_idm1341015184" role="bascode" localize="false" xml-lang="en-US">Dim siStep As Single</paragraph>
+<paragraph id="par_id3153158" role="bascode" xml-lang="en-US"> For siStep = 0 To 10 ' Fill array with test data</paragraph>
+<paragraph id="par_idm1341012208" role="bascode" localize="false" xml-lang="en-US"> sListArray(siStep) = chr(siStep + 65)</paragraph>
+<paragraph id="par_idm1341010944" role="bascode" localize="false" xml-lang="en-US"> MsgBox sListArray(siStep)</paragraph>
+<paragraph id="par_idm1341009696" role="bascode" localize="false" xml-lang="en-US"> Next siStep</paragraph>
+<paragraph id="par_idm1341008464" role="bascode" localize="false" xml-lang="en-US"> sReturn = LinSearch(sListArray(), "B")</paragraph>
+<paragraph id="par_idm1341007200" role="bascode" localize="false" xml-lang="en-US"> Print sReturn</paragraph>
+<paragraph id="par_idm1341005968" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
+<paragraph id="par_idm1341004736" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
+<paragraph id="par_idm1341003488" role="bascode" localize="false" xml-lang="en-US">Function LinSearch( sList(), sItem As String ) As Integer</paragraph>
+<paragraph id="par_idm1341002208" role="bascode" localize="false" xml-lang="en-US">Dim iCount As Integer</paragraph>
+<paragraph id="par_id3153764" role="bascode" xml-lang="en-US">' LinSearch searches a TextArray:sList() for a TextEntry:</paragraph>
+<paragraph id="par_id3148995" role="bascode" xml-lang="en-US">' Returns the index of the entry or 0 (Null)</paragraph>
+<paragraph id="par_idm1340997424" role="bascode" localize="false" xml-lang="en-US"> For iCount=1 To Ubound( sList() )</paragraph>
+<paragraph id="par_idm1340996176" role="bascode" localize="false" xml-lang="en-US"> If sList( iCount ) = sItem Then</paragraph>
+<paragraph id="par_id3149567" role="bascode" xml-lang="en-US"> Exit For ' sItem found</paragraph>
+<paragraph id="par_idm1340993200" role="bascode" localize="false" xml-lang="en-US"> End If</paragraph>
+<paragraph id="par_idm1340991968" role="bascode" localize="false" xml-lang="en-US"> Next iCount</paragraph>
+<paragraph id="par_idm1340990736" role="bascode" localize="false" xml-lang="en-US"> If iCount = Ubound( sList() ) Then iCount = 0</paragraph>
+<paragraph id="par_idm1340989472" role="bascode" localize="false" xml-lang="en-US"> LinSearch = iCount</paragraph>
+<paragraph id="par_idm1340988240" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
+</bascode>
+</body>
+</helpdocument> \ No newline at end of file