diff --git a/source/text/sbasic/shared/03120306.xhp b/source/text/sbasic/shared/03120306.xhp index 58bd2cc581..86f9a3990d 100644 --- a/source/text/sbasic/shared/03120306.xhp +++ b/source/text/sbasic/shared/03120306.xhp @@ -17,62 +17,55 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - - Mid Function, Mid Statement + Mid Function, Mid Statement /text/sbasic/shared/03120306.xhp - - -
- + Mid function - Mid statement - - -

Mid Function, Mid Statement

-Returns the specified portion of a string expression (Mid function), or replaces the portion of a string expression with another string (Mid statement). +

Mid Function

+Returns the specified portion of a string expression (Mid function), or replaces the portion of a string expression with another string (Mid subroutine).
- -Mid (Text As String, Start As Long [, Length As Long]) -Mid (Text As String, Start As Long, Length As Long, Text As String) - +Mid(string As String, Start As Long [, Length As Long]) As String +Mid([ByRef] string As String, Start As Long, [Length As Long], Text As String) - -String (only by Function) - +String (only by Function) - Text: Any string expression that you want to modify. - Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The minimum allowed value is 1. The maximum allowed value is 2,147,483,648.see i17928 - Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 2,147,483,648. -If the Length parameter in the Mid function is omitted, all characters in the string expression from the start position to the end of the string are returned. -If the Length parameter in the Mid statement is less than the length of the text that you want to replace, the text is reduced to the specified length. - Text: The string to replace the string expression (Mid statement). + string: Any string expression that you want to extract (Mid function). Any text variable name that you want to modify (Mid subroutine). + Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The minimum allowed value is 1. The maximum allowed value is 2,147,483,648.see i17928 + Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 2,147,483,648. +If the Length parameter in the Mid function is omitted, all characters in the string expression from the start position to the end of the string are returned. +If the Length parameter in the Mid subroutine is less than the length of the text that you want to replace, the text is reduced to the specified length. + Text: The string to replace the string expression (Mid subroutine). - -Sub ExampleMid_Function_and_Statement - original_text = "This is the original Text" -' Mid as function - msgbox Mid( original_text , 13, 8) ' returns the word original - msgbox original_text ' original_text not modified -' Mid as statement - Mid( original_text, 13, 8, "new" ) - msgbox original_text ' returns This is the new Text -End Sub +Sub ExampleMid_Function_and_Statement + text = "This is the original Text" +func1: + MsgBox Mid(text, 13, 8) ' returns the word "original" + MsgBox text ' text is not modified +stmt1: + Mid(text, 13, 8, "new") + MsgBox text ' returns "This is the new Text" +func2: + MsgBox Mid(start:=10, string:="The quick brown fox ..") ' shows " brown fox .." +stmt2: + Mid text, 9, 12, "a new Phrase" + MsgBox text ' returns "This is a new Phrase" +End Sub
- + \ No newline at end of file