From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03090203.xhp | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03090203.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03090203.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03090203.xhp b/helpcontent2/source/text/sbasic/shared/03090203.xhp new file mode 100644 index 000000000..dad29dca3 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03090203.xhp @@ -0,0 +1,72 @@ + + + + + + + +While...Wend Statement +/text/sbasic/shared/03090203.xhp + + +Sun Microsystems, Inc. + + + + +
+ + While;While...Wend loop + While;While Wend loop + + While...Wend Statement + When a program encounters a While statement, it tests the condition. If the condition is False, the program continues directly following the Wend statement. If the condition is True, the loop is executed until the program finds Wend and then jumps back to the While statement. If the condition is still True, the loop is executed again. +
+ Unlike the Do...Loop statement, you cannot cancel a While...Wend loop with Exit. Never exit a While...Wend loop with GoTo, since this can cause a run-time error. + A Do...Loop is more flexible than a While...Wend. + + + + While syntax + + + While Condition [statements] Wend + + + + Sub ExampleWhileWend + Dim stext As String + Dim iRun As Integer + sText ="This is a short text" + iRun = 1 + While iRun < Len(sText) + If Mid(sText,iRun,1 )<> " " Then Mid( sText ,iRun, 1) = Chr( 1 + Asc( Mid(sText,iRun,1 )) ) + iRun = iRun + 1 + Wend + MsgBox sText,0,"Text encoded" + End Sub + + +
+ Do...Until or Do...While statement + Exit statement +
+ + +
-- cgit v1.2.3