From 6522d1a261301211b35885ee9709f64f9a587edb Mon Sep 17 00:00:00 2001 From: LibreOfficiant Date: Mon, 4 May 2020 17:17:09 +0200 Subject: tdf#131416 Syntax diagrams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Print & Select Case statements - GoSub,GoTo, On…GoSub/GoTo statements - section reuse + x-refs Change-Id: I785d46013d7e8e9f571b2a2d2abaa3e2e41d223f Reviewed-on: https://gerrit.libreoffice.org/c/help/+/93376 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/sbasic/shared/03010103.xhp | 17 +++++----- source/text/sbasic/shared/03090102.xhp | 15 +++++---- source/text/sbasic/shared/03090301.xhp | 46 ++++++++++++++----------- source/text/sbasic/shared/03090302.xhp | 61 +++++++++++++++++++++------------- source/text/sbasic/shared/03090303.xhp | 29 ++++++++++------ 5 files changed, 99 insertions(+), 69 deletions(-) (limited to 'source/text') diff --git a/source/text/sbasic/shared/03010103.xhp b/source/text/sbasic/shared/03010103.xhp index 5e7fb6a495..52cccd7ecf 100644 --- a/source/text/sbasic/shared/03010103.xhp +++ b/source/text/sbasic/shared/03010103.xhp @@ -42,22 +42,23 @@ Outputs the specified strings or numeric expressions to a dialog or to a file. -Syntax: + +Print syntax -Print [#FileName,] Expression1[{;|,} [Spc(Number As Integer);] [Tab(pos As Integer);] [Expression2[...]] +Print [#filenum,] expression1[{;|,} [Spc(number As Integer);] [Tab(pos As Integer);] [expression2[...]] -Parameter: - FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file.see i61758 - Expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted. - Number: Number of spaces to be inserted by the Spc function. - Pos: Spaces are inserted until the specified position. + + filenum: Any numeric expression that contains the file number that was set by the Open statement for the respective file.see i61758 + expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted. + number: Number of spaces to be inserted by the Spc function. + pos: Spaces are inserted until the specified position. If a semicolon or comma appears after the last expression to be printed, $[officename] Basic stores the text in an internal buffer and continues program execution without printing. When another Print statement without a semicolon or comma at the end is encountered, all text to be printed is printed at once. Positive numeric expressions are printed with a leading space. Negative expressions are printed with a leading minus sign. If a certain range is exceeded for floating-point values, the respective numeric expression is printed in exponential notation. If the expression to be printed exceeds a certain length, the display will automatically wrap to the next line. You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces. -Example: + diff --git a/source/text/sbasic/shared/03090102.xhp b/source/text/sbasic/shared/03090102.xhp index 97f6eeaec4..7d9eb53cc2 100644 --- a/source/text/sbasic/shared/03090102.xhp +++ b/source/text/sbasic/shared/03090102.xhp @@ -30,8 +30,8 @@
- Select...Case statement - Case statement + Select Case statement + Case keyword; in Select Case statement @@ -39,16 +39,17 @@ Defines one or more statement blocks depending on the value of an expression.
-Syntax: + +Select Case syntax Select Case condition Case expression Statement Block [Case expression2 Statement Block][Case Else] Statement Block End Select -Parameters: - Condition: Any expression that controls if the statement block that follows the respective Case clause is executed. - Expression: Any expression that is compatible with the Condition type expression. The statement block that follows the Case clause is executed if Condition matches Expression. + + condition: Any expression that controls if the statement block that follows the respective Case clause is executed. + expression: Any expression that is compatible with the condition type expression. The statement block that follows the Case clause is executed if condition matches expression. -Example: + Sub ExampleRandomSelect Dim iVar As Integer diff --git a/source/text/sbasic/shared/03090301.xhp b/source/text/sbasic/shared/03090301.xhp index 7335110a23..b2331842bc 100644 --- a/source/text/sbasic/shared/03090301.xhp +++ b/source/text/sbasic/shared/03090301.xhp @@ -27,38 +27,40 @@ -
GoSub...Return statement + label; in GoSub...Return statement - -GoSub...Return Statement -Calls a subroutine that is indicated by a label from a subroutine or a function. The statements following the label are executed until the next Return statement. Afterwards, the program continues with the statement that follows the GoSub statement. +

GoSub...Return Statement

+ Calls a subroutine that is indicated by a label inside a Sub or a Function. The statements following the label are executed until the next Return statement. Afterwards, the program continues with the statement that follows the GoSub statement.
-Syntax: + + +GoSub label[:] + + + +label: A line identifier indicating where to continue execution. The scope of a label in that of the routine it belongs to. +The GoSub statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":"). -see Parameters + Sub/Function foo + ' statements + GoSub label + ' statements + Exit Sub/Function + label: + ' statements + Return + End Sub/Function -Parameters: -Sub/Function -statement block - Label -statement block -GoSub Label -Exit Sub/Function -Label: -statement block -Return -End Sub/Function -The GoSub statement calls a local subroutine indicated by a label from within a subroutine or a function. The name of the label must end with a colon (":"). If the program encounters a Return statement not preceded by GoSub, $[officename] Basic returns an error message. Use Exit Sub or Exit Function to ensure that the program leaves a Sub or Function before reaching the next Return statement. The following example demonstrates the use of GoSub and Return. By executing a program section twice, the program calculates the square root of two numbers that are entered by the user. -Example: + Sub ExampleGoSub Dim iInputa As Single @@ -78,6 +80,12 @@ Return End Sub + +
+ + +
+ \ No newline at end of file diff --git a/source/text/sbasic/shared/03090302.xhp b/source/text/sbasic/shared/03090302.xhp index 44ada012a9..720aa3fdcc 100644 --- a/source/text/sbasic/shared/03090302.xhp +++ b/source/text/sbasic/shared/03090302.xhp @@ -19,40 +19,53 @@ --> + - -GoTo Statement -/text/sbasic/shared/03090302.xhp - - -Sun Microsystems, Inc. - + + GoTo Statement + /text/sbasic/shared/03090302.xhp + + + Sun Microsystems, Inc. + +
-GoTo statement + + GoTo statement + label; in GoTo statement -GoTo Statement -Continues program execution within a Sub or Function at the procedure line indicated by a label. +GoTo Statement + Continues program execution within a Sub or Function at the procedure line indicated by a label.
Syntax: -see Parameters + +GoTo label[:] + + Parameters: +label: A line identifier indicating where to continue execution. The scope of a label in that of the routine it belongs to. + Use the GoTo statement to instruct $[officename] Basic to continue program execution at another place within the procedure. The position must be indicated by a label. To set a label, assign a name, and then and end it with a colon (":"). + You cannot use the GoTo statement to jump out of a Sub or Function. +Example: - Sub/Function - statement block - Label1 - Label2: - statement block - Exit Sub - Label1: - statement block - GoTo Label2 + Sub/Function + ' statement block + GoTo Label1 + Label2: + ' statement block + Exit Sub/Function + Label1: + ' statement block + GoTo Label2 End Sub/Function -Use the GoTo statement to instruct $[officename] Basic to continue program execution at another place within the procedure. The position must be indicated by a label. To set a label, assign a name, and then and end it with a colon (":"). -You cannot use the GoTo statement to jump out of a Sub or Function. -Example: -see Parameters + +
+ + +
+
diff --git a/source/text/sbasic/shared/03090303.xhp b/source/text/sbasic/shared/03090303.xhp index ea82af131a..cad7a574fb 100644 --- a/source/text/sbasic/shared/03090303.xhp +++ b/source/text/sbasic/shared/03090303.xhp @@ -1,5 +1,4 @@ - + @@ -27,30 +27,32 @@ -
On...GoSub statement On...GoTo statement + label; in On...GoSub statement + label; in On...GoTo statement -On...GoSub Statement; On...GoTo Statement +

On...GoSub Statement; On...GoTo Statement

Branches to one of several specified lines in the program code, depending on the value of a numeric expression.
-Syntax: + +On GoSub/GoTo syntax -On N GoSub Label1[, Label2[, Label3[,...]]] -On NumExpression GoTo Label1[, Label2[, Label3[,...]]] +On expression GoSub Label1[, Label2[, Label3[,...]]] +On expression GoTo Label1[, Label2[, Label3[,...]]] -Parameters: - NumExpression: Any numeric expression between 0 and 255 that determines which of the lines the program branches to. If NumExpression is 0, the statement is not executed. If NumExpression is greater than 0, the program jumps to the label that has a position number that corresponds to the expression (1 = First label; 2 = Second label) - Label: Target line according to GoTo or GoSub structure. + + expression: Any numeric expression between 0 and 255 that determines which of the lines the program branches to. If expression is 0, the statement is not executed. If expression is greater than 0, the program jumps to the label that has a position number that corresponds to the expression (1 = First label; 2 = Second label) + label: Target line according to GoTo or GoSub structure. The GoTo or GoSub conventions are valid. -Example: + Sub ExampleOnGosub Dim iVar As Integer @@ -72,6 +74,11 @@ MsgBox sVar,0,"On...GoSub" End Sub + +
+ + +
+ -
\ No newline at end of file -- cgit