From 61173c1b58efa79c0ba6b08348d2796a249d0186 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sat, 1 Sep 2012 09:51:27 -0500 Subject: move help structure one directory up Change-Id: Ie970e39fbb6795a92d9fdd13510409d7dcd071bc --- source/text/sbasic/shared/03090201.xhp | 107 +++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 source/text/sbasic/shared/03090201.xhp (limited to 'source/text/sbasic/shared/03090201.xhp') diff --git a/source/text/sbasic/shared/03090201.xhp b/source/text/sbasic/shared/03090201.xhp new file mode 100644 index 0000000000..e3a08323c7 --- /dev/null +++ b/source/text/sbasic/shared/03090201.xhp @@ -0,0 +1,107 @@ + + + + + + + + +Do...Loop Statement [Runtime] +/text/sbasic/shared/03090201.xhp + + +Sun Microsystems, Inc. +converted from old format - fpe + + + +
+Do...Loop statement +While; Do loop +Until +loops + +Do...Loop Statement [Runtime] +Repeats the statements between the Do and the Loop statement while the condition is True or until the condition becomes True. +
+Syntax +Do [{While | Until} condition = True] +statement block +[Exit Do] +statement block +Loop +or +Do +statement block +[Exit Do] +statement block +Loop [{While | Until} condition = True] +Parameters/Elements + +Condition: A comparison, numeric or string expression, that evaluates either True or False. + +Statement block: Statements that you want to repeat while or until the condition is True. +The Do...Loop statement executes a loop as long as, or until, a certain condition is True. The condition for exiting the loop must be entered following either the Do or the Loop statement. The following examples are valid combinations: +Syntax +Do While condition = True +...statement block +Loop +The statement block between the Do While and the Loop statements is repeated so long as the condition is true. +Do Until condition = True +...statement block +Loop +The statement block between the Do Until and the Loop statements is repeated if the condition so long as the condition is false. +Do +...statement block +Loop While condition = True +The statement block between the Do and the Loop statements repeats so long as the condition is true. +Do +...statement block +Loop Until condition = True +The statement block between the Do and the Loop statements repeats until the condition is true. +Use the Exit Do statement to unconditionally end the loop. You can add this statement anywhere in a Do...Loop statement. You can also define an exit condition using the If...Then structure as follows: +Do... +statements +If condition = True Then Exit Do +statements +Loop... +Example +Sub ExampleDoLoop +Dim sFile As String +Dim sPath As String +sPath = "c:\" +sFile = Dir$( sPath ,22) +If sFile <> "" Then +Do +MsgBox sFile +sFile = Dir$ +Loop Until sFile = "" +End If +End Sub + +
-- cgit