source/text/sbasic/shared/03020414.xhp | 40 ++++++-------- source/text/sbasic/shared/03120202.xhp | 22 ++++---- source/text/sbasic/shared/03120303.xhp | 26 ++++----- source/text/sbasic/shared/03120307.xhp | 26 ++++----- source/text/sbasic/shared/03120314.xhp | 87 +++++++++++++++----------------- source/text/sbasic/shared/03120403.xhp | 45 +++++++--------- source/text/sbasic/shared/partition.xhp | 26 ++++----- source/text/sbasic/shared/strconv.xhp | 4 - 8 files changed, 133 insertions(+), 143 deletions(-)
New commits: commit f3a16adcb0187df5cf9c01ae6b4550785c03375b Author: Alain Romedenne <alain.romede...@libreoffice.org> AuthorDate: Mon Mar 6 12:34:55 2023 +0000 Commit: Alain Romedenne <alain.romede...@libreoffice.org> CommitDate: Mon Mar 13 17:49:09 2023 +0000 tdf#141474 Incorrect parameter names for Basic functions in help Skipped items: Mid, MIRR, NPV, Shell: - MID statement is bugged, TDF#154166 refers, no need to change it yet. MID function operates fine - MIRR and NPV do not support named arguments in VBA despite MS documentation. No need to update those pages - Shell keyword arguments are correct Change-Id: I09dcc280edeec158eafaf87286966c36447ff71b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/148316 Tested-by: Jenkins Reviewed-by: Alain Romedenne <alain.romede...@libreoffice.org> diff --git a/source/text/sbasic/shared/03020414.xhp b/source/text/sbasic/shared/03020414.xhp index c476c7e4dc..633a7a856f 100644 --- a/source/text/sbasic/shared/03020414.xhp +++ b/source/text/sbasic/shared/03020414.xhp @@ -33,20 +33,17 @@ <bookmark_value>SetAttr statement</bookmark_value> </bookmark> - -<paragraph id="hd_id3147559" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03020414.xhp">SetAttr Statement</link></paragraph> +<h1 id="hd_id3147559" ><link href="text/sbasic/shared/03020414.xhp">SetAttr Statement</link></h1> <paragraph id="par_id3147264" role="paragraph" xml-lang="en-US">Sets the attribute information for a specified file.</paragraph> </section> -<paragraph id="hd_id3150359" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> -<bascode> -<paragraph id="par_id3154365" role="bascode" xml-lang="en-US">SetAttr FileName As String, Attribute As Integer</paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/><bascode> +<paragraph id="par_id3154365" role="bascode" xml-lang="en-US">SetAttr PathName As String, Attributes As Integer</paragraph> </bascode> -<paragraph id="hd_id3125863" role="heading" level="2" xml-lang="en-US">Parameters:</paragraph> -<paragraph id="par_id3154909" role="paragraph" xml-lang="en-US">FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, <emph>SetAttr</emph> searches for the file in the current directory. You can also use <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> -<paragraph id="par_id3153192" role="paragraph" xml-lang="en-US"> <emph>Attribute:</emph> Bit pattern defining the attributes that you want to set or to clear:</paragraph> -<paragraph id="par_id3145786" role="paragraph" xml-lang="en-US"> <emph>Value</emph> </paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functparameters"/> +<paragraph id="par_id3154909" role="paragraph" xml-lang="en-US"> <emph>FileName</emph>: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, <emph>SetAttr</emph> searches for the file in the current directory. You can also use <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> +<paragraph id="par_id3153192" role="paragraph" xml-lang="en-US"> <emph>Attributes</emph>: Bit pattern defining the attributes that you want to set or to clear:</paragraph> <table id="Table1"> <tablerow> @@ -101,21 +98,20 @@ <embed href="text/sbasic/shared/00000003.xhp#err53"/> <embed href="text/sbasic/shared/00000003.xhp#err70"/> -<paragraph id="hd_id3147434" role="heading" level="2" xml-lang="en-US">Example:</paragraph> -<bascode> +<embed href="text/sbasic/shared/00000003.xhp#functexample"/><bascode> <paragraph id="par_idm1340803584" role="bascode" localize="false" xml-lang="en-US">Sub ExampleSetGetAttr</paragraph> <paragraph id="par_id3148645" role="bascode" xml-lang="en-US"> On Error GoTo ErrorHandler ' Define target for error handler</paragraph> -<paragraph id="par_idm1340800592" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph> -<paragraph id="par_idm1340799328" role="bascode" localize="false" xml-lang="en-US"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph> -<paragraph id="par_idm1340798016" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" ,0</paragraph> -<paragraph id="par_idm1340796752" role="bascode" localize="false" xml-lang="en-US"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph> -<paragraph id="par_idm1341620608" role="bascode" localize="false" xml-lang="en-US"> SetAttr "c:\test\autoexec.sav" , ATTR_READONLY</paragraph> -<paragraph id="par_idm1341619344" role="bascode" localize="false" xml-lang="en-US"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph> -<paragraph id="par_idm1341618080" role="bascode" localize="false" xml-lang="en-US"> End</paragraph> -<paragraph id="par_idm1341616848" role="bascode" localize="false" xml-lang="en-US">ErrorHandler:</paragraph> -<paragraph id="par_idm1341615616" role="bascode" localize="false" xml-lang="en-US"> Print Error</paragraph> -<paragraph id="par_idm1341614384" role="bascode" localize="false" xml-lang="en-US"> End</paragraph> -<paragraph id="par_idm1341613152" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1340800592" role="bascode" localize="false"> If Dir("C:\test",16)="" Then MkDir "C:\test"</paragraph> +<paragraph id="par_idm1340799328" role="bascode" localize="false"> If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph> +<paragraph id="par_idm1340798016" role="bascode" localize="false"> SetAttr "c:\test\autoexec.sav" ,0</paragraph> +<paragraph id="par_idm1340796752" role="bascode" localize="false"> FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"</paragraph> +<paragraph id="par_idm1341620608" role="bascode" localize="false"> SetAttr "c:\test\autoexec.sav" , ATTR_READONLY</paragraph> +<paragraph id="par_idm1341619344" role="bascode" localize="false"> Print GetAttr( "c:\test\autoexec.sav" )</paragraph> +<paragraph id="par_idm1341618080" role="bascode" localize="false"> End</paragraph> +<paragraph id="par_idm1341616848" role="bascode" localize="false">ErrorHandler:</paragraph> +<paragraph id="par_idm1341615616" role="bascode" localize="false"> Print Error</paragraph> +<paragraph id="par_idm1341614384" role="bascode" localize="false"> End</paragraph> +<paragraph id="par_idm1341613152" role="bascode" localize="false">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03120202.xhp b/source/text/sbasic/shared/03120202.xhp index 6b4f6442c4..35a424d83f 100644 --- a/source/text/sbasic/shared/03120202.xhp +++ b/source/text/sbasic/shared/03120202.xhp @@ -40,28 +40,28 @@ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3149233" role="bascode" xml-lang="en-US">String (n As Long, {expression As Integer | character As String})</paragraph> +<paragraph id="par_id3149233" role="bascode" xml-lang="en-US">String (number As Long, {expression As Integer | character As String}) As String</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3147530" role="paragraph" xml-lang="en-US">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3154347" role="paragraph" xml-lang="en-US"> <emph>n:</emph> Numeric expression that indicates the number of characters to return in the string. The maximum allowed value of n is 2,147,483,648.</paragraph> -<paragraph id="par_id3148664" role="paragraph" xml-lang="en-US"> <emph>Expression:</emph> Numeric expression that defines the ASCII code for the character.</paragraph> -<paragraph id="par_id3150359" role="paragraph" xml-lang="en-US"> <emph>Character:</emph> Any single character used to build the return string, or any string of which only the first character will be used.</paragraph> +<paragraph id="par_id3154347" role="paragraph" xml-lang="en-US"> <emph>number</emph>: Numeric expression that indicates the number of characters to return in the string. The maximum allowed value of n is 2,147,483,648.</paragraph> +<paragraph id="par_id3148664" role="paragraph" xml-lang="en-US"> <emph>Expression</emph>: Numeric expression that defines the ASCII code for the character.</paragraph> +<paragraph id="par_id3150359" role="paragraph" xml-lang="en-US"> <emph>Character</emph>: Any single character used to build the return string, or any string of which only the first character will be used.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> -<paragraph id="par_idm1340924160" role="bascode" localize="false" xml-lang="en-US">Sub ExampleString</paragraph> -<paragraph id="par_idm1340922928" role="bascode" localize="false" xml-lang="en-US">Dim sText As String</paragraph> -<paragraph id="par_idm1340921696" role="bascode" localize="false" xml-lang="en-US"> sText = String(10,"A")</paragraph> -<paragraph id="par_idm1340920448" role="bascode" localize="false" xml-lang="en-US"> MsgBox sText</paragraph> -<paragraph id="par_idm1340919216" role="bascode" localize="false" xml-lang="en-US"> sText = String(10,65)</paragraph> -<paragraph id="par_idm1340917968" role="bascode" localize="false" xml-lang="en-US"> MsgBox sText</paragraph> -<paragraph id="par_idm1340916736" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1340924160" role="bascode" localize="false">Sub ExampleString</paragraph> +<paragraph id="par_idm1340922928" role="bascode" localize="false">Dim sText As String</paragraph> +<paragraph id="par_idm1340921696" role="bascode" localize="false"> sText = String(10,"A")</paragraph> +<paragraph id="par_idm1340920448" role="bascode" localize="false"> MsgBox sText</paragraph> +<paragraph id="par_idm1340919216" role="bascode" localize="false"> sText = String(10,65)</paragraph> +<paragraph id="par_idm1340917968" role="bascode" localize="false"> MsgBox sText</paragraph> +<paragraph id="par_idm1340916736" role="bascode" localize="false">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/03120303.xhp b/source/text/sbasic/shared/03120303.xhp index da879b8d3c..7989d07cac 100644 --- a/source/text/sbasic/shared/03120303.xhp +++ b/source/text/sbasic/shared/03120303.xhp @@ -40,32 +40,32 @@ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3150771" role="bascode" xml-lang="en-US">Left (Text As String, n As Long)</paragraph> +<paragraph id="par_id3150771" role="bascode" xml-lang="en-US">Left (string As String, length As Long) As String</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3147530" role="paragraph" xml-lang="en-US">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3148552" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string expression that you want to return the leftmost characters from.</paragraph> -<paragraph id="par_id3149456" role="paragraph" xml-lang="en-US"> <emph>n:</emph> Numeric expression that specifies the number of characters that you want to return. If <emph>n</emph> = 0, a zero-length string is returned. The maximum allowed value is 2,147,483,648.</paragraph> +<paragraph id="par_id3148552" role="paragraph" xml-lang="en-US"> <emph>string</emph>: Any string expression that you want to return the leftmost characters from.</paragraph> +<paragraph id="par_id3149456" role="paragraph" xml-lang="en-US"> <emph>length</emph>: Numeric expression that specifies the number of characters that you want to return. If <emph>length</emph> = 0, a zero-length string is returned. The maximum allowed value is 2,147,483,648.</paragraph> <paragraph id="par_id3150791" role="paragraph" xml-lang="en-US">The following example converts a date in YYYY.MM.DD format to MM/DD/YYYY format.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> -<paragraph id="par_idm1340818096" role="bascode" localize="false" xml-lang="en-US">Sub ExampleUSDate</paragraph> -<paragraph id="par_idm1340816864" role="bascode" localize="false" xml-lang="en-US">Dim sInput As String</paragraph> -<paragraph id="par_idm1340815632" role="bascode" localize="false" xml-lang="en-US">Dim sUS_date As String</paragraph> +<paragraph id="par_idm1340818096" role="bascode" localize="false">Sub ExampleUSDate</paragraph> +<paragraph id="par_idm1340816864" role="bascode" localize="false">Dim sInput As String</paragraph> +<paragraph id="par_idm1340815632" role="bascode" localize="false">Dim sUS_date As String</paragraph> <paragraph id="par_id3150448" role="bascode" xml-lang="en-US"> sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'")</paragraph> -<paragraph id="par_idm1340812576" role="bascode" localize="false" xml-lang="en-US"> sUS_date = Mid(sInput, 6, 2)</paragraph> -<paragraph id="par_idm1340811328" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & "/"</paragraph> -<paragraph id="par_idm1340810064" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & Right(sInput, 2)</paragraph> -<paragraph id="par_idm1340808800" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & "/"</paragraph> -<paragraph id="par_idm1340807536" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & Left(sInput, 4)</paragraph> -<paragraph id="par_idm1340806272" role="bascode" localize="false" xml-lang="en-US"> MsgBox sUS_date</paragraph> -<paragraph id="par_idm1340805040" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1340812576" role="bascode" localize="false"> sUS_date = Mid(sInput, 6, 2)</paragraph> +<paragraph id="par_idm1340811328" role="bascode" localize="false"> sUS_date = sUS_date & "/"</paragraph> +<paragraph id="par_idm1340810064" role="bascode" localize="false"> sUS_date = sUS_date & Right(sInput, 2)</paragraph> +<paragraph id="par_idm1340808800" role="bascode" localize="false"> sUS_date = sUS_date & "/"</paragraph> +<paragraph id="par_idm1340807536" role="bascode" localize="false"> sUS_date = sUS_date & Left(sInput, 4)</paragraph> +<paragraph id="par_idm1340806272" role="bascode" localize="false"> MsgBox sUS_date</paragraph> +<paragraph id="par_idm1340805040" role="bascode" localize="false">End Sub</paragraph> </bascode> <section id="relatedtopics"> <paragraph role="paragraph" id="par_id161599082457466" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#stringfunctions"/></paragraph> diff --git a/source/text/sbasic/shared/03120307.xhp b/source/text/sbasic/shared/03120307.xhp index cf27d174d2..a0c9892b57 100644 --- a/source/text/sbasic/shared/03120307.xhp +++ b/source/text/sbasic/shared/03120307.xhp @@ -41,32 +41,32 @@ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3153061" role="bascode" xml-lang="en-US">Right (Text As String, n As Long)</paragraph> +<paragraph id="par_id3153061" role="bascode" xml-lang="en-US">Right (string As String, length As Long)</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3156344" role="paragraph" xml-lang="en-US">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3153526" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string expression that you want to return the rightmost characters of.</paragraph> -<paragraph id="par_id3151211" role="paragraph" xml-lang="en-US"> <emph>n:</emph> Numeric expression that defines the number of characters that you want to return. If <emph>n</emph> = 0, a zero-length string is returned. The maximum allowed value is 2,147,483,648.</paragraph> +<paragraph id="par_id3153526" role="paragraph" xml-lang="en-US"> <emph>string</emph>: Any string expression that you want to return the rightmost characters of.</paragraph> +<paragraph id="par_id3151211" role="paragraph" xml-lang="en-US"> <emph>length</emph>: Numeric expression that defines the number of characters that you want to return. If <emph>length</emph> = 0, a zero-length string is returned. The maximum allowed value is 2,147,483,648.</paragraph> <paragraph id="par_id3158410" role="paragraph" xml-lang="en-US">The following example converts a date in YYYY-MM-DD format to the US date format (MM/DD/YYYY).</paragraph> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> -<paragraph id="par_idm1341027360" role="bascode" localize="false" xml-lang="en-US">Sub ExampleUSDate</paragraph> -<paragraph id="par_idm1341026128" role="bascode" localize="false" xml-lang="en-US">Dim sInput As String</paragraph> -<paragraph id="par_idm1341024896" role="bascode" localize="false" xml-lang="en-US">Dim sUS_date As String</paragraph> +<paragraph id="par_idm1341027360" role="bascode" localize="false">Sub ExampleUSDate</paragraph> +<paragraph id="par_idm1341026128" role="bascode" localize="false">Dim sInput As String</paragraph> +<paragraph id="par_idm1341024896" role="bascode" localize="false">Dim sUS_date As String</paragraph> <paragraph id="par_id3159252" role="bascode" xml-lang="en-US"> sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'")</paragraph> -<paragraph id="par_idm1341021888" role="bascode" localize="false" xml-lang="en-US"> sUS_date = Mid(sInput, 6, 2)</paragraph> -<paragraph id="par_idm1341020640" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & "/"</paragraph> -<paragraph id="par_idm1341019376" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & Right(sInput, 2)</paragraph> -<paragraph id="par_idm1341018112" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & "/"</paragraph> -<paragraph id="par_idm1341016848" role="bascode" localize="false" xml-lang="en-US"> sUS_date = sUS_date & Left(sInput, 4)</paragraph> -<paragraph id="par_idm1341015584" role="bascode" localize="false" xml-lang="en-US"> MsgBox sUS_date</paragraph> -<paragraph id="par_idm1341014352" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1341021888" role="bascode" localize="false"> sUS_date = Mid(sInput, 6, 2)</paragraph> +<paragraph id="par_idm1341020640" role="bascode" localize="false"> sUS_date = sUS_date & "/"</paragraph> +<paragraph id="par_idm1341019376" role="bascode" localize="false"> sUS_date = sUS_date & Right(sInput, 2)</paragraph> +<paragraph id="par_idm1341018112" role="bascode" localize="false"> sUS_date = sUS_date & "/"</paragraph> +<paragraph id="par_idm1341016848" role="bascode" localize="false"> sUS_date = sUS_date & Left(sInput, 4)</paragraph> +<paragraph id="par_idm1341015584" role="bascode" localize="false"> MsgBox sUS_date</paragraph> +<paragraph id="par_idm1341014352" role="bascode" localize="false">End Sub</paragraph> </bascode> <section id="relatedtopics"> <paragraph role="paragraph" id="par_id161599082457466" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#stringfunctions"/></paragraph> diff --git a/source/text/sbasic/shared/03120314.xhp b/source/text/sbasic/shared/03120314.xhp index 7aa0ebcab7..569c52f6c3 100644 --- a/source/text/sbasic/shared/03120314.xhp +++ b/source/text/sbasic/shared/03120314.xhp @@ -40,60 +40,59 @@ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3153824" role="bascode" xml-lang="en-US">Split (Text As String, delimiter, number)</paragraph> +<paragraph id="par_id3153824" role="bascode" xml-lang="en-US">Split (expression As String, delimiter, limit)</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3154285" role="paragraph" xml-lang="en-US">With Option VBASupport 1: String, with Option VBASupport 0: Variant/String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3156023" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string expression.</paragraph> -<paragraph id="par_id3147560" role="paragraph" xml-lang="en-US"> <emph>delimiter (optional):</emph> A string of one or more characters length that is used to delimit the Text. The default is the space character.</paragraph> -<paragraph id="par_id3145069" role="paragraph" xml-lang="en-US"> <emph>number (optional):</emph> The number of substrings that you want to return.</paragraph> +<paragraph id="par_id3156023" role="paragraph" xml-lang="en-US"> <emph>expression</emph>: Any string expression.</paragraph> +<paragraph id="par_id3147560" role="paragraph" xml-lang="en-US"> <emph>delimiter</emph>: An optional string of one or more characters length that is used to delimit <literal>String</literal>. The default is the space character.</paragraph> +<paragraph id="par_id3145069" role="paragraph" xml-lang="en-US"> <emph>limit</emph>: An optional number of substrings that you want to return.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> - <section id="splitjoinex"> <bascode> -<paragraph id="par_idm1341285008" role="bascode" localize="false" xml-lang="en-US">Dim a(3)</paragraph> -<paragraph id="par_idm1341283776" role="bascode" localize="false" xml-lang="en-US">Sub main()</paragraph> -<paragraph id="par_idm1341282544" role="bascode" localize="false" xml-lang="en-US"> a(0) = "ABCDE"</paragraph> -<paragraph id="par_idm1341281312" role="bascode" localize="false" xml-lang="en-US"> a(1) = 42</paragraph> -<paragraph id="par_idm1341280080" role="bascode" localize="false" xml-lang="en-US"> a(2) = "MN"</paragraph> -<paragraph id="par_idm1341278848" role="bascode" localize="false" xml-lang="en-US"> a(3) = "X Y Z"</paragraph> -<paragraph id="par_idm1341277616" role="bascode" localize="false" xml-lang="en-US"> JStr = Join1()</paragraph> -<paragraph id="par_idm1341276384" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph> -<paragraph id="par_idm1341275136" role="bascode" localize="false" xml-lang="en-US"> JStr = Join2()</paragraph> -<paragraph id="par_idm1341273904" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph> -<paragraph id="par_idm1341272656" role="bascode" localize="false" xml-lang="en-US"> JStr = Join3()</paragraph> -<paragraph id="par_idm1341271424" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph> -<paragraph id="par_idm1341270176" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> -<paragraph id="par_idm1341268944" role="bascode" localize="false" xml-lang="en-US"> </paragraph> -<paragraph id="par_idm1341267696" role="bascode" localize="false" xml-lang="en-US">Function Join1()</paragraph> -<paragraph id="par_idm1341266464" role="bascode" localize="false" xml-lang="en-US"> Join1 = Join(a(), "abc")</paragraph> -<paragraph id="par_idm1341265216" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> -<paragraph id="par_idm1341263984" role="bascode" localize="false" xml-lang="en-US"> </paragraph> -<paragraph id="par_idm1341262784" role="bascode" localize="false" xml-lang="en-US">Function Join2()</paragraph> -<paragraph id="par_idm1341261552" role="bascode" localize="false" xml-lang="en-US"> Join2 = Join(a(), ",")</paragraph> -<paragraph id="par_idm1341260304" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> -<paragraph id="par_idm1341259072" role="bascode" localize="false" xml-lang="en-US"> </paragraph> -<paragraph id="par_idm1341257872" role="bascode" localize="false" xml-lang="en-US">Function Join3()</paragraph> -<paragraph id="par_idm1341256640" role="bascode" localize="false" xml-lang="en-US"> Join3 = Join(a())</paragraph> -<paragraph id="par_idm1341255408" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> -<paragraph id="par_idm1341254176" role="bascode" localize="false" xml-lang="en-US"> </paragraph> -<paragraph id="par_idm1341252976" role="bascode" localize="false" xml-lang="en-US">Function Split1(aStr)</paragraph> -<paragraph id="par_idm1341251744" role="bascode" localize="false" xml-lang="en-US"> Split1 = Split(aStr, "D")</paragraph> -<paragraph id="par_idm1341250496" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph> -<paragraph id="par_idm1341249264" role="bascode" localize="false" xml-lang="en-US"> </paragraph> -<paragraph id="par_idm1341248064" role="bascode" localize="false" xml-lang="en-US">Sub Show(JoinStr, TheArray)</paragraph> -<paragraph id="par_idm1341246816" role="bascode" localize="false" xml-lang="en-US"> l = LBound(TheArray)</paragraph> -<paragraph id="par_idm1341245568" role="bascode" localize="false" xml-lang="en-US"> u = UBound(TheArray)</paragraph> -<paragraph id="par_idm1341244320" role="bascode" localize="false" xml-lang="en-US"> total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13)</paragraph> -<paragraph id="par_idm1341243024" role="bascode" localize="false" xml-lang="en-US"> For i = l To u</paragraph> -<paragraph id="par_idm1341241792" role="bascode" localize="false" xml-lang="en-US"> total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13)</paragraph> -<paragraph id="par_idm1341240496" role="bascode" localize="false" xml-lang="en-US"> Next i</paragraph> -<paragraph id="par_idm1341239264" role="bascode" localize="false" xml-lang="en-US"> MsgBox total$</paragraph> -<paragraph id="par_idm1341238032" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1341285008" role="bascode" localize="false">Dim a(3)</paragraph> +<paragraph id="par_idm1341283776" role="bascode" localize="false">Sub main()</paragraph> +<paragraph id="par_idm1341282544" role="bascode" localize="false"> a(0) = "ABCDE"</paragraph> +<paragraph id="par_idm1341281312" role="bascode" localize="false"> a(1) = 42</paragraph> +<paragraph id="par_idm1341280080" role="bascode" localize="false"> a(2) = "MN"</paragraph> +<paragraph id="par_idm1341278848" role="bascode" localize="false"> a(3) = "X Y Z"</paragraph> +<paragraph id="par_idm1341277616" role="bascode" localize="false"> JStr = Join1()</paragraph> +<paragraph id="par_idm1341276384" role="bascode" localize="false"> Call Show(JStr, Split1(JStr))</paragraph> +<paragraph id="par_idm1341275136" role="bascode" localize="false"> JStr = Join2()</paragraph> +<paragraph id="par_idm1341273904" role="bascode" localize="false"> Call Show(JStr, Split1(JStr))</paragraph> +<paragraph id="par_idm1341272656" role="bascode" localize="false"> JStr = Join3()</paragraph> +<paragraph id="par_idm1341271424" role="bascode" localize="false"> Call Show(JStr, Split1(JStr))</paragraph> +<paragraph id="par_idm1341270176" role="bascode" localize="false">End Sub</paragraph> +<paragraph id="par_idm1341268944" role="bascode" localize="false"> </paragraph> +<paragraph id="par_idm1341267696" role="bascode" localize="false">Function Join1()</paragraph> +<paragraph id="par_idm1341266464" role="bascode" localize="false"> Join1 = Join(a(), "abc")</paragraph> +<paragraph id="par_idm1341265216" role="bascode" localize="false">End Function</paragraph> +<paragraph id="par_idm1341263984" role="bascode" localize="false"> </paragraph> +<paragraph id="par_idm1341262784" role="bascode" localize="false">Function Join2()</paragraph> +<paragraph id="par_idm1341261552" role="bascode" localize="false"> Join2 = Join(a(), ",")</paragraph> +<paragraph id="par_idm1341260304" role="bascode" localize="false">End Function</paragraph> +<paragraph id="par_idm1341259072" role="bascode" localize="false"> </paragraph> +<paragraph id="par_idm1341257872" role="bascode" localize="false">Function Join3()</paragraph> +<paragraph id="par_idm1341256640" role="bascode" localize="false"> Join3 = Join(a())</paragraph> +<paragraph id="par_idm1341255408" role="bascode" localize="false">End Function</paragraph> +<paragraph id="par_idm1341254176" role="bascode" localize="false"> </paragraph> +<paragraph id="par_idm1341252976" role="bascode" localize="false">Function Split1(aStr)</paragraph> +<paragraph id="par_idm1341251744" role="bascode" localize="false"> Split1 = Split(aStr, "D")</paragraph> +<paragraph id="par_idm1341250496" role="bascode" localize="false">End Function</paragraph> +<paragraph id="par_idm1341249264" role="bascode" localize="false"> </paragraph> +<paragraph id="par_idm1341248064" role="bascode" localize="false">Sub Show(JoinStr, TheArray)</paragraph> +<paragraph id="par_idm1341246816" role="bascode" localize="false"> l = LBound(TheArray)</paragraph> +<paragraph id="par_idm1341245568" role="bascode" localize="false"> u = UBound(TheArray)</paragraph> +<paragraph id="par_idm1341244320" role="bascode" localize="false"> total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13)</paragraph> +<paragraph id="par_idm1341243024" role="bascode" localize="false"> For i = l To u</paragraph> +<paragraph id="par_idm1341241792" role="bascode" localize="false"> total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13)</paragraph> +<paragraph id="par_idm1341240496" role="bascode" localize="false"> Next i</paragraph> +<paragraph id="par_idm1341239264" role="bascode" localize="false"> MsgBox total$</paragraph> +<paragraph id="par_idm1341238032" role="bascode" localize="false">End Sub</paragraph> </bascode> </section> <section id="relatedtopics"> diff --git a/source/text/sbasic/shared/03120403.xhp b/source/text/sbasic/shared/03120403.xhp index a1e959299c..defd183601 100644 --- a/source/text/sbasic/shared/03120403.xhp +++ b/source/text/sbasic/shared/03120403.xhp @@ -27,54 +27,49 @@ <body> - <section id="strcomp"> <bookmark xml-lang="en-US" branch="index" id="bm_id3156027"> <bookmark_value>StrComp function</bookmark_value> </bookmark> - -<paragraph id="hd_id3156027" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03120403.xhp">StrComp Function</link></paragraph> +<h1 id="hd_id3156027" xml-lang="en-US"><link href="text/sbasic/shared/03120403.xhp">StrComp Function</link></h1> <paragraph id="par_id3155805" role="paragraph" xml-lang="en-US">Compares two strings and returns an integer value that represents the result of the comparison.</paragraph> </section> -<paragraph id="hd_id3153345" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3150503" role="bascode" xml-lang="en-US">StrComp (Text1 As String, Text2 As String[, Compare])</paragraph> +<paragraph id="par_id3150503" role="bascode" xml-lang="en-US">StrComp (string1 As String, string2 As String[, Compare As Integer]) As Integer</paragraph> </bascode> -<paragraph id="hd_id3147574" role="heading" level="2" xml-lang="en-US">Return value:</paragraph> -<paragraph id="par_id3156152" localize="false" role="paragraph">Integer</paragraph> - -<paragraph id="hd_id3150984" role="heading" level="2" xml-lang="en-US">Parameter:</paragraph> -<paragraph id="par_id3153061" role="paragraph" xml-lang="en-US"> <emph>Text1:</emph> Any string expression</paragraph> -<paragraph id="par_id3147560" role="paragraph" xml-lang="en-US"> <emph>Text2:</emph> Any string expression</paragraph> -<paragraph id="par_id3146796" role="paragraph" xml-lang="en-US"> <emph>Compare:</emph> This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters.</paragraph> - -<paragraph id="hd_id3154940" role="heading" level="3" xml-lang="en-US">Return value</paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functparameters"/> +<paragraph id="par_id3351061" role="paragraph" xml-lang="en-US"> <emph>string1</emph>: Any string expression</paragraph> +<paragraph id="par_id3153061" role="paragraph" xml-lang="en-US"> <emph>string2</emph>: Any string expression</paragraph> +<paragraph id="par_id3146796" role="paragraph" xml-lang="en-US"> <emph>Compare</emph>: This optional parameter sets the comparison method. If <literal>Compare</literal> = 1, the string comparison is case-sensitive. If <literal>Compare</literal> = 0, no distinction is made between uppercase and lowercase letters.</paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functvalue"/> +<paragraph id="par_id3156152" localize="false" role="paragraph">Integer</paragraph> <list type="unordered"> <listitem> - <paragraph id="par_id3150358" role="listitem" xml-lang="en-US">If Text1 < Text2 the function returns -1</paragraph> + <paragraph id="par_id3150358" role="listitem" xml-lang="en-US">If string1 < string2 the function returns -1</paragraph> </listitem> <listitem> - <paragraph id="par_id3151043" role="listitem" xml-lang="en-US">If Text1 = Text2 the function returns 0</paragraph> + <paragraph id="par_id3151043" role="listitem" xml-lang="en-US">If string1 = string2 the function returns 0</paragraph> </listitem> <listitem> - <paragraph id="par_id3158410" role="listitem" xml-lang="en-US">If Text1 > Text2 the function returns 1</paragraph> + <paragraph id="par_id3158410" role="listitem" xml-lang="en-US">If string1 > string2 the function returns 1</paragraph> </listitem></list> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> -<paragraph id="hd_id3153968" role="heading" level="2" xml-lang="en-US">Example:</paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> -<paragraph id="par_idm1341100656" role="bascode" localize="false" xml-lang="en-US">Sub ExampleStrComp</paragraph> -<paragraph id="par_idm1341099424" role="bascode" localize="false" xml-lang="en-US">Dim iVar As Single</paragraph> -<paragraph id="par_idm1341098192" role="bascode" localize="false" xml-lang="en-US">Dim sVar As String</paragraph> -<paragraph id="par_idm1341096960" role="bascode" localize="false" xml-lang="en-US"> iVar = 123.123</paragraph> -<paragraph id="par_idm1341095728" role="bascode" localize="false" xml-lang="en-US"> sVar = Str$(iVar)</paragraph> -<paragraph id="par_idm1341094496" role="bascode" localize="false" xml-lang="en-US"> MsgBox strcomp(sVar , Str$(iVar),1)</paragraph> -<paragraph id="par_idm1341093248" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_idm1341100656" role="bascode" localize="false">Sub ExampleStrComp</paragraph> +<paragraph id="par_idm1341099424" role="bascode" localize="false">Dim iVar As Single</paragraph> +<paragraph id="par_idm1341098192" role="bascode" localize="false">Dim sVar As String</paragraph> +<paragraph id="par_idm1341096960" role="bascode" localize="false"> iVar = 123.123</paragraph> +<paragraph id="par_idm1341095728" role="bascode" localize="false"> sVar = Str$(iVar)</paragraph> +<paragraph id="par_idm1341094496" role="bascode" localize="false"> MsgBox strcomp(sVar , Str$(iVar),1)</paragraph> +<paragraph id="par_idm1341093248" role="bascode" localize="false">End Sub</paragraph> </bascode> </body> diff --git a/source/text/sbasic/shared/partition.xhp b/source/text/sbasic/shared/partition.xhp index 8099f860d1..0f72b05cc8 100644 --- a/source/text/sbasic/shared/partition.xhp +++ b/source/text/sbasic/shared/partition.xhp @@ -25,33 +25,33 @@ </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> - <paragraph role="code" id="par_id111548419647867">Partition( Number, Start, End, Interval)</paragraph> + <paragraph role="code" id="par_id111548419647867">Partition( Number, Start, Stop, Interval)</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph role="paragraph" localize="false" id="par_id971548420129767">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> <paragraph role="paragraph" id="par_id481548420000538"><emph>Number</emph>: Required. The number to determine the partition.</paragraph> <paragraph role="paragraph" id="par_id841548420006137"><emph>Start</emph>: Required. An integer number defining the lower value of the range of numbers.</paragraph> - <paragraph role="paragraph" id="par_id781548420012105"><emph>End</emph>: Required. An integer number defining the highest value of the range.</paragraph> - <paragraph role="paragraph" id="par_id371548420017250"><emph>Interval</emph>: Required. An integer number that specifies the size of the partitions within the range of numbers (between Start and End).</paragraph> + <paragraph role="paragraph" id="par_id781548420012105"><emph>Stop</emph>: Required. An integer number defining the highest value of the range.</paragraph> + <paragraph role="paragraph" id="par_id371548420017250"><emph>Interval</emph>: Required. An integer number that specifies the size of the partitions within the range of numbers (between <literal>Start</literal> and <literal>Stop</literal>).</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> - <paragraph role="bascode" id="par_id321548420503855" xml-lang="en-US" localize="false">Option VBASupport 1</paragraph> - <paragraph role="bascode" id="par_id431548420514604" xml-lang="en-US" localize="false">Option Explicit</paragraph> - <paragraph role="bascode" id="par_id181548420522842" xml-lang="en-US" localize="false">Sub Test_Partition</paragraph> - <paragraph role="bascode" id="par_id721548420527861" xml-lang="en-US" localize="false"> Dim retStr As String</paragraph> - <paragraph role="bascode" id="par_id21548420534821" xml-lang="en-US" localize="false"> retStr = Partition(20, 0, 98, 5)</paragraph> + <paragraph role="bascode" id="par_id321548420503855" localize="false">Option VBASupport 1</paragraph> + <paragraph role="bascode" id="par_id431548420514604" localize="false">Option Explicit</paragraph> + <paragraph role="bascode" id="par_id181548420522842" localize="false">Sub Test_Partition</paragraph> + <paragraph role="bascode" id="par_id721548420527861" localize="false"> Dim retStr As String</paragraph> + <paragraph role="bascode" id="par_id21548420534821" localize="false"> retStr = Partition(20, 0, 98, 5)</paragraph> <paragraph role="bascode" id="par_id561548420541509" xml-lang="en-US"> print "20:24 the number 20 occurs in the range: " & retStr</paragraph> - <paragraph role="bascode" id="par_id261548420553088" xml-lang="en-US" localize="false"> retStr = Partition(20, 0, 99, 1)</paragraph> + <paragraph role="bascode" id="par_id261548420553088" localize="false"> retStr = Partition(20, 0, 99, 1)</paragraph> <paragraph role="bascode" id="par_id161548420558523" xml-lang="en-US"> print " 20: 20 the number 20 occurs in the range: " & retStr</paragraph> - <paragraph role="bascode" id="par_id251548420573894" xml-lang="en-US" localize="false"> retStr = Partition(120, 0, 99, 5)</paragraph> + <paragraph role="bascode" id="par_id251548420573894" localize="false"> retStr = Partition(120, 0, 99, 5)</paragraph> <paragraph role="bascode" id="par_id561548420579525" xml-lang="en-US"> print "100: the number 120 occurs in the range: " & retStr</paragraph> - <paragraph role="bascode" id="par_id611548420591014" xml-lang="en-US" localize="false"> retStr = Partition(-5, 0, 99, 5)</paragraph> + <paragraph role="bascode" id="par_id611548420591014" localize="false"> retStr = Partition(-5, 0, 99, 5)</paragraph> <paragraph role="bascode" id="par_id921548420596118" xml-lang="en-US"> print " : -1 the number -5 occurs in the range: " & retStr</paragraph> - <paragraph role="bascode" id="par_id561548420604604" xml-lang="en-US" localize="false"> retStr = Partition(2, 0, 5, 2)</paragraph> + <paragraph role="bascode" id="par_id561548420604604" localize="false"> retStr = Partition(2, 0, 5, 2)</paragraph> <paragraph role="bascode" id="par_id861548420616153" xml-lang="en-US" > print " 2: 3 the number 2 occurs in the range: " & retStr</paragraph> - <paragraph role="bascode" id="par_id841548421054219" xml-lang="en-US" localize="false">End Sub</paragraph> + <paragraph role="bascode" id="par_id841548421054219" localize="false">End Sub</paragraph> </bascode> <section id="relatedtopics"> <embed href="text/sbasic/shared/00000003.xhp#VBAMath"/> diff --git a/source/text/sbasic/shared/strconv.xhp b/source/text/sbasic/shared/strconv.xhp index 9f596990e0..8bee911a87 100644 --- a/source/text/sbasic/shared/strconv.xhp +++ b/source/text/sbasic/shared/strconv.xhp @@ -24,11 +24,11 @@ </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> -<paragraph role="code" id="par_id771622762489917">StrConv(Text, Conversion, [ LCID ])</paragraph> +<paragraph role="code" id="par_id771622762489917">StrConv(string As String, Conversion As Integer, [ LCID ])</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph role="paragraph" id="par_id971548420129767" localize="false">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph role="paragraph" id="par_id421622762822934"><emph>Text</emph>: Any valid string expression.</paragraph> +<paragraph role="paragraph" id="par_id421622762822934"><emph>string</emph>: Any valid string expression.</paragraph> <paragraph role="paragraph" id="par_id671622762931475"><emph>Conversion</emph>: The type of conversion to perform, as defined in the table below.</paragraph> <section id="StrConv_constants"> <table id="tab_id91622763145456">