diff options
author | Alain Romedenne <alain.romedenne@libreoffice.org> | 2023-03-01 08:50:21 +0000 |
---|---|---|
committer | Alain Romedenne <alain.romedenne@libreoffice.org> | 2023-03-06 12:22:42 +0000 |
commit | 6f339f367d1ee6aa8d13b41eaf3ca19bca9926e6 (patch) | |
tree | 9d5ace44cf890ea27caceb3a74f7c8cd1ec18c4c | |
parent | c76109de27348a1b751ac398b978ebfa3a8825dc (diff) |
tdf#141474 Incorrect parameter names for Basic functions in help
Remaining pages up to included Join function
Change-Id: Id6aad2fbdf3ace72fdaa33136fc71a6107abeadd
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/147986
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r-- | source/text/sbasic/shared/03020404.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03020405.xhp | 14 | ||||
-rw-r--r-- | source/text/sbasic/shared/03020406.xhp | 8 | ||||
-rw-r--r-- | source/text/sbasic/shared/03090103.xhp | 8 | ||||
-rw-r--r-- | source/text/sbasic/shared/03120315.xhp | 6 | ||||
-rw-r--r-- | source/text/sbasic/shared/03120401.xhp | 17 | ||||
-rw-r--r-- | source/text/sbasic/shared/03120411.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03132300.xhp | 42 | ||||
-rw-r--r-- | source/text/sbasic/shared/03140003.xhp | 28 | ||||
-rw-r--r-- | source/text/sbasic/shared/03150000.xhp | 6 |
10 files changed, 87 insertions, 62 deletions
diff --git a/source/text/sbasic/shared/03020404.xhp b/source/text/sbasic/shared/03020404.xhp index dc18b5af80..6f1d84acc4 100644 --- a/source/text/sbasic/shared/03020404.xhp +++ b/source/text/sbasic/shared/03020404.xhp @@ -38,15 +38,15 @@ <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3156282" role="bascode" localize="false">Dir [(Text As String [, Attrib As Integer])]</paragraph> +<paragraph id="par_id3156282" role="bascode" localize="false">Dir [(PathName As String [, Attributes As Integer])]</paragraph> </bascode> -<h2 id="hd_id3156424" xml-lang="en-US">Return value:</h2> +<embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3153193" role="paragraph" xml-lang="en-US">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3161831" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string expression that specifies the search path, directory or file. This argument can only be specified the first time that you call the Dir function. If you want, you can enter the path in <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> -<paragraph id="par_id3146974" role="paragraph" xml-lang="en-US"> <emph>Attrib: </emph>Any integer expression that specifies bitwise file attributes. The Dir function only returns files or directories that match the specified attributes. You can combine several attributes by adding the attribute values:</paragraph> +<paragraph id="par_id3161831" role="paragraph" xml-lang="en-US"> <emph>PathName</emph>: Any string expression that specifies the search path, directory or file. This argument can only be specified the first time that you call the Dir function. If you want, you can enter the path in <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> +<paragraph id="par_id3146974" role="paragraph" xml-lang="en-US"> <emph>Attributes</emph>:Any integer expression that specifies bitwise file attributes. The Dir function only returns files or directories that match the specified attributes. You can combine several attributes by adding the attribute values:</paragraph> <paragraph id="par_id3149666" role="paragraph" xml-lang="en-US">0 : Normal files.</paragraph> <paragraph id="par_id3147427" role="paragraph" xml-lang="en-US">16 : Returns the name of the directory only.</paragraph> <paragraph id="par_id3153952" role="paragraph" xml-lang="en-US">Use this attribute to check if a file or directory exists, or to determine all files and folders in a specific directory.</paragraph> @@ -80,6 +80,8 @@ </bascode> <section id="relatedtopics"> <embed href="text/sbasic/shared/03020403.xhp#CurDir_h1"/> + <embed href="text/sbasic/shared/compatibilitymode.xhp#compatibilitymodeh1"/> + <embed href="text/sbasic/shared/03103350.xhp#vbasupportstatement"/> </section> </body> </helpdocument> diff --git a/source/text/sbasic/shared/03020405.xhp b/source/text/sbasic/shared/03020405.xhp index f1ba3fb4d5..0a61715239 100644 --- a/source/text/sbasic/shared/03020405.xhp +++ b/source/text/sbasic/shared/03020405.xhp @@ -34,25 +34,25 @@ </bookmark> -<paragraph id="hd_id3153380" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03020405.xhp">FileAttr Function</link></paragraph> +<h1 id="hd_id3153380" xml-lang="en-US"><link href="text/sbasic/shared/03020405.xhp">FileAttr Function</link></h1> <paragraph id="par_id3154366" role="paragraph" xml-lang="en-US">Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle).</paragraph> </section> -<paragraph id="par_id3153364" role="note" xml-lang="en-US">If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number.</paragraph> +<paragraph id="par_id3153364" role="note" xml-lang="en-US">If you use a 32-Bit operating system, you cannot use the FileAttr function to determine the file access number.</paragraph> <paragraph id="par_id3163713" role="paragraph" xml-lang="en-US">See also: <link href="text/sbasic/shared/03020103.xhp">Open</link></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3154012" role="bascode" xml-lang="en-US">FileAttr (FileNumber As Integer, Attribute As Integer)</paragraph> + <paragraph id="par_id3154012" role="bascode" xml-lang="en-US">FileAttr (Channel As Integer, Attributes As Integer)</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3146974" role="paragraph" xml-lang="en-US">Integer</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3151074" role="paragraph" xml-lang="en-US"> <emph>FileNumber:</emph> The number of the file that was opened with the Open statement.</paragraph> -<paragraph id="par_id3144766" role="paragraph" xml-lang="en-US"> <emph>Attribute:</emph> Integer expression that indicates the type of file information that you want to return. The following values are possible:</paragraph> -<paragraph id="par_id3147396" role="paragraph" xml-lang="en-US">1: The FileAttr-Function indicates the access mode of the file.</paragraph> -<paragraph id="par_id3149959" role="paragraph" xml-lang="en-US">2: The FileAttr-Function returns the file access number of the operating system.</paragraph> +<paragraph id="par_id3151074" role="paragraph" xml-lang="en-US"> <emph>Channel</emph>: The number of the file that was opened with the Open statement.</paragraph> +<paragraph id="par_id3144766" role="paragraph" xml-lang="en-US"> <emph>Attributes</emph>: Integer expression that indicates the type of file information that you want to return. The following values are possible:</paragraph> +<paragraph id="par_id3147396" role="paragraph" xml-lang="en-US">1: FileAttr indicates the access mode of the file.</paragraph> +<paragraph id="par_id3149959" role="paragraph" xml-lang="en-US">2: FileAttr returns the file access number of the operating system.</paragraph> <paragraph id="par_id3154018" role="paragraph" xml-lang="en-US">If you specify a parameter attribute with a value of 1, the following return values apply:</paragraph> <paragraph id="par_id3149124" role="paragraph" xml-lang="en-US">1 - INPUT (file open for input)</paragraph> <paragraph id="par_id3156275" role="paragraph" xml-lang="en-US">2 - OUTPUT (file open for output)</paragraph> diff --git a/source/text/sbasic/shared/03020406.xhp b/source/text/sbasic/shared/03020406.xhp index b7a762f9a7..04b32654dd 100644 --- a/source/text/sbasic/shared/03020406.xhp +++ b/source/text/sbasic/shared/03020406.xhp @@ -34,18 +34,18 @@ </bookmark> -<paragraph id="hd_id3154840" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03020406.xhp">FileCopy Statement</link></paragraph> +<h1 id="hd_id3154840" xml-lang="en-US"><link href="text/sbasic/shared/03020406.xhp">FileCopy Statement</link></h1> <paragraph id="par_id3149497" role="paragraph" xml-lang="en-US">Copies a file.</paragraph> </section> <paragraph id="hd_id3147443" role="heading" level="2" xml-lang="en-US">Syntax:</paragraph> <bascode> -<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">FileCopy TextFrom As String, TextTo As String</paragraph> +<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">FileCopy Source As String, Destination As String</paragraph> </bascode> <paragraph id="hd_id3153825" role="heading" level="2" xml-lang="en-US">Parameters:</paragraph> -<paragraph id="par_id3155390" role="paragraph" xml-lang="en-US"> <emph>TextFrom:</emph> Any string expression that specifies the name of the file that you want to copy. The expression can contain optional path and drive information. If you want, you can enter a path in <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> -<paragraph id="par_id3150669" role="paragraph" xml-lang="en-US"> <emph>TextTo:</emph> Any string expression that specifies where you want to copy the source file to. The expression can contain the destination drive, the path, and file name, or the path in URL notation.</paragraph> +<paragraph id="par_id3155390" role="paragraph" xml-lang="en-US"> <emph>Source</emph>: Any string expression that specifies the name of the file that you want to copy. The expression can contain optional path and drive information. If you want, you can enter a path in <link href="text/sbasic/shared/00000002.xhp">URL notation</link>.</paragraph> +<paragraph id="par_id3150669" role="paragraph" xml-lang="en-US"> <emph>Destination</emph>: Any string expression that specifies where you want to copy the source file to. The expression can contain the destination drive, the path, and file name, or the path in URL notation.</paragraph> <paragraph id="par_id3150791" role="note" xml-lang="en-US">You can only use the FileCopy statement to copy files that are not opened.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> diff --git a/source/text/sbasic/shared/03090103.xhp b/source/text/sbasic/shared/03090103.xhp index 67c24baf55..d0780bd7c1 100644 --- a/source/text/sbasic/shared/03090103.xhp +++ b/source/text/sbasic/shared/03090103.xhp @@ -35,14 +35,14 @@ </section> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph role="bascode" id="par_id3147560" xml-lang="en-US">IIf (Expression, ExpressionTrue, ExpressionFalse)</paragraph> +<paragraph role="bascode" id="par_id3147560" xml-lang="en-US">IIf (Bool As Boolean, Variant1 As Variant, Variant2 As Variant) As Variant</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> <paragraph role="paragraph" id="par_id3153381" xml-lang="en-US"> -<emph>Expression:</emph> Any expression that you want to evaluate. If the expression evaluates to <emph>True</emph>, the function returns the result of ExpressionTrue, otherwise it returns the result of ExpressionFalse.</paragraph> +<emph>Bool</emph>: Any expression that you want to evaluate. If the expression evaluates to <emph>True</emph>, the function returns the value of Variant1, otherwise it returns the value of Variant2.</paragraph> <paragraph role="paragraph" id="par_id3150870" xml-lang="en-US"> -<emph>ExpressionTrue, ExpressionFalse:</emph> Any expression, one of which will be returned as the function result, depending on the logical evaluation.</paragraph> -<note id="par_id541598638231139">IIf evaluates both <literal>ExpressionTrue</literal> and <literal>ExpressionFalse</literal> even if it returns only one of them. If one of the expressions results in error, the function returns the error. For example, do not use IIF to bypass a possible division by zero result.</note> +<emph>Variant1, Variant2</emph>: Any expression, one of which will be returned as the function result, depending on the logical evaluation.</paragraph> +<note id="par_id541598638231139">IIf evaluates both <literal>Variant1</literal> and <literal>Variant2</literal> even if it returns only one of them. If one of the expressions results in error, the function returns the error. For example, do not use IIF to bypass a possible division by zero result.</note> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> diff --git a/source/text/sbasic/shared/03120315.xhp b/source/text/sbasic/shared/03120315.xhp index 4ac47a1946..848620e685 100644 --- a/source/text/sbasic/shared/03120315.xhp +++ b/source/text/sbasic/shared/03120315.xhp @@ -35,13 +35,13 @@ </section> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph role="bascode" id="par_id3156344" xml-lang="en-US">Join (Text As String Array, delimiter)</paragraph> +<paragraph role="bascode" id="par_id3156344" xml-lang="en-US">Join (SourceArray As Object, delimiter As String) As String</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph role="paragraph" localize="false" id="par_id3150359">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph role="paragraph" id="par_id3145171" xml-lang="en-US"><emph>Text:</emph> A string array.</paragraph> -<paragraph role="paragraph" id="par_id3154908" xml-lang="en-US"><emph>delimiter (optional):</emph> A string character that is used to separate the substrings in the resulting string. The default delimiter is the space character. If delimiter is a string of length zero "", the substrings are joined without separator.</paragraph> +<paragraph role="paragraph" id="par_id3145171" xml-lang="en-US"><emph>SourceArray</emph>: A string array.</paragraph> +<paragraph role="paragraph" id="par_id3154908" xml-lang="en-US"><emph>delimiter</emph>: An optional string character that is used to separate the substrings in the resulting string. The default delimiter is the space character. If <literal>Delimiter</literal> is a string of length zero "", the substrings are joined without separator.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <embed href="text/sbasic/shared/03120314.xhp#splitjoinex"/> <section id="relatedtopics"> diff --git a/source/text/sbasic/shared/03120401.xhp b/source/text/sbasic/shared/03120401.xhp index e0b79638e5..49b2ade943 100644 --- a/source/text/sbasic/shared/03120401.xhp +++ b/source/text/sbasic/shared/03120401.xhp @@ -33,25 +33,24 @@ <bookmark_value>InStr function</bookmark_value> </bookmark> - <h1 id="hd_id3155934"><link href="text/sbasic/shared/03120401.xhp">InStr Function</link></h1> <paragraph id="par_id3153990" role="paragraph" xml-lang="en-US">Returns the position of a string within another string.</paragraph> </section> <paragraph id="par_id3147303" role="paragraph" xml-lang="en-US">The Instr function returns the position at which the match was found. If the string was not found, the function returns 0.</paragraph> -<h2 id="hd_id3145090">Syntax:</h2> +<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">InStr ([Start As Long,] Text1 As String, Text2 As String[, Compare])</paragraph> +<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">InStr ([Start As Long,] String1 As String, String2 As String[, Compare]) As Integer</paragraph> </bascode> -<h2 id="hd_id3148538">Return value:</h2> +<embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3149763" localize="false" role="paragraph">Integer</paragraph> -<h2 id="hd_id3148473">Parameters:</h2> -<paragraph id="par_id3153126" role="paragraph" xml-lang="en-US"> <emph>Start: </emph>A numeric expression that marks the position in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the first character of the string. The minimum allowed value is 1. The maximum allowed value is 2,147,483,648.<comment>see i17928</comment></paragraph> -<paragraph id="par_id3145609" role="paragraph" xml-lang="en-US"> <emph>Text1:</emph> The string expression that you want to search.</paragraph> -<paragraph id="par_id3147559" role="paragraph" xml-lang="en-US"> <emph>Text2:</emph> The string expression that you want to search for.</paragraph> -<paragraph id="par_id3154758" role="paragraph" xml-lang="en-US"> <emph>Compare:</emph> Optional numeric expression that defines the type of comparison. The value of this parameter can be 0 or 1. The default value of 1 specifies a text comparison that is not case-sensitive. The value of 0 specifies a binary comparison that is case-sensitive.<comment>fixes i17929</comment></paragraph> +<embed href="text/sbasic/shared/00000003.xhp#functparameters"/> +<paragraph id="par_id3153126" role="paragraph" xml-lang="en-US"> <emph>Start</emph>: A numeric expression that marks the position in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the first character of the string. The minimum allowed value is 1. The maximum allowed value is 2,147,483,648.<comment>see i17928</comment></paragraph> +<paragraph id="par_id3145609" role="paragraph" xml-lang="en-US"> <emph>String1</emph>: The string expression that you want to search.</paragraph> +<paragraph id="par_id3147559" role="paragraph" xml-lang="en-US"> <emph>String2</emph>: The string expression that you want to search for.</paragraph> +<paragraph id="par_id3154758" role="paragraph" xml-lang="en-US"> <emph>Compare</emph>: Optional numeric expression that defines the type of comparison. The value of this parameter can be 0 or 1. The default value of 1 specifies a text comparison that is not case-sensitive. The value of 0 specifies a binary comparison that is case-sensitive.<comment>fixes i17929</comment></paragraph> <paragraph id="par_id3153361" role="paragraph" xml-lang="en-US">To avoid a run-time error, do not set the Compare parameter if the first optional parameter is omitted.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#errorcode"/> <embed href="text/sbasic/shared/00000003.xhp#err5"/> diff --git a/source/text/sbasic/shared/03120411.xhp b/source/text/sbasic/shared/03120411.xhp index 31327d0466..11e1130a73 100644 --- a/source/text/sbasic/shared/03120411.xhp +++ b/source/text/sbasic/shared/03120411.xhp @@ -34,25 +34,25 @@ </bookmark> -<paragraph id="hd_id3155934" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03120411.xhp">InStrRev Function [VBA]</link></paragraph> +<h1 id="hd_id3155934" xml-lang="en-US"><link href="text/sbasic/shared/03120411.xhp">InStrRev Function [VBA]</link></h1> <paragraph id="par_id3153990" role="paragraph" xml-lang="en-US">Returns the position of a string within another string, starting from the right side of the string. </paragraph> </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <paragraph id="par_id3147303" role="paragraph" xml-lang="en-US">The InStrRev function returns the position at which the match was found, from the right. If the string was not found, the function returns 0.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">InStrRev (Text1 As String, Text2 As String [,Start As Long] [, Compare As Integer])</paragraph> +<paragraph id="par_id3146957" role="bascode" xml-lang="en-US">InStrRev (StringCheck As String, StringMatch As String [,Start As Long] [, Compare As Integer])</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3149763" localize="false" role="paragraph">Long</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id3145609" role="paragraph" xml-lang="en-US"> <emph>Text1:</emph> The string expression that you want to search.</paragraph> -<paragraph id="par_id3147559" role="paragraph" xml-lang="en-US"> <emph>Text2:</emph> The string expression that you want to search for.</paragraph> +<paragraph id="par_id3145609" role="paragraph" xml-lang="en-US"> <emph>StringCheck</emph>: The string expression that you want to search.</paragraph> +<paragraph id="par_id3147559" role="paragraph" xml-lang="en-US"> <emph>StringMatch</emph>: The string expression that you want to search for.</paragraph> <paragraph id="par_id3153126" role="paragraph" xml-lang="en-US"> <emph>Start: </emph>Optional numeric expression that marks the position <emph>from the left </emph>in a string where the search for the specified substring starts. If you omit this parameter, the search starts at the last character of the string. The maximum allowed value is 65535.</paragraph> <paragraph id="par_id3154758" role="paragraph" xml-lang="en-US"> <emph>Compare:</emph> Optional numeric expression that defines the type of comparison. The value of this parameter can be </paragraph> <paragraph id="par_id051920170326028042" role="paragraph" xml-lang="en-US">1: The default value of 1 specifies a text comparison that is not case-sensitive.</paragraph> <paragraph id="par_id051920170326027721" role="paragraph" xml-lang="en-US">0: The value of 0 specifies a binary comparison that is case-sensitive.</paragraph> -<paragraph id="par_id3153361" role="paragraph" xml-lang="en-US">To avoid a run-time error, do not set the Compare parameter if the first return parameter is omitted.</paragraph> +<paragraph id="par_id3153361" role="paragraph" xml-lang="en-US">To avoid a run-time error, do not set the <literal>Compare</literal> parameter if the first return parameter is omitted.</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"/> diff --git a/source/text/sbasic/shared/03132300.xhp b/source/text/sbasic/shared/03132300.xhp index 80a2fa351c..2bcf886671 100644 --- a/source/text/sbasic/shared/03132300.xhp +++ b/source/text/sbasic/shared/03132300.xhp @@ -32,16 +32,40 @@ <section id="createunovalue"> <bookmark xml-lang="en-US" branch="index" id="bm_id3150682"><bookmark_value>CreateUnoValue function</bookmark_value> </bookmark> -<paragraph role="heading" id="hd_id3150682" xml-lang="en-US" level="1"><link href="text/sbasic/shared/03132300.xhp">CreateUnoValue Function</link></paragraph> +<h1 id="hd_id3150682" xml-lang="en-US"><link href="text/sbasic/shared/03132300.xhp">CreateUnoValue Function</link></h1> <paragraph role="paragraph" id="par_id3147291" xml-lang="en-US">Returns an object that represents a strictly typed value referring to the Uno type system. </paragraph> </section> -<paragraph role="paragraph" id="par_id3143267" xml-lang="en-US">This object is automatically converted to an Any of the corresponding type when passed to Uno. The type must be specified by its fully qualified Uno type name.</paragraph> -<paragraph role="note" id="par_id3153626" xml-lang="en-US">The $[officename] API frequently uses the Any type. It is the counterpart of the Variant type known from other environments. The Any type holds one arbitrary Uno type and is used in generic Uno interfaces.</paragraph> + +<paragraph role="paragraph" id="par_id3143267" xml-lang="en-US">This object is automatically converted to an <literal>Any</literal> of the corresponding type when passed to Uno. The type must be specified by its fully qualified Uno type name.</paragraph> +<paragraph role="note" id="par_id3153626" xml-lang="en-US">The $[officename] API frequently uses the <literal>Any</literal> type. It is the counterpart of the <literal>Variant</literal> type known from other environments. The <literal>Any</literal> type holds one arbitrary Uno type and is used in generic Uno interfaces.</paragraph> + <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> -<paragraph role="code" id="par_id3154760" xml-lang="en-US">oUnoValue = CreateUnoValue( "[]byte", MyBasicValue ) ' to get a byte sequence.</paragraph> -<paragraph role="paragraph" id="par_id3150541" xml-lang="en-US">If <literal>CreateUnoValue</literal> cannot be converted to the specified Uno type, and error occurs. For the conversion, the <literal>com.sun.star.script.Converter</literal> service is used.</paragraph> -<paragraph role="paragraph" id="par_id3153524" xml-lang="en-US">This function is intended for use in situations where the default Basic to Uno type converting mechanism is insufficient. This can happen when you try to access generic Any based interfaces, such as <literal>XPropertySet::setPropertyValue( Name, Value )</literal> or <literal>X???Container::insertBy???( ???, Value )</literal>, from $[officename] Basic. The Basic runtime does not recognize these types as they are only defined in the corresponding service.</paragraph> -<paragraph role="paragraph" id="par_id3154366" xml-lang="en-US">In this type of situation, $[officename] Basic chooses the best matching type for the Basic type that you want to convert. However, if the wrong type is selected, an error occurs. You use the <literal>CreateUnoValue()</literal> function to create a value for the unknown Uno type.</paragraph> -<paragraph role="paragraph" id="par_id3150769" xml-lang="en-US">You can also use this function to pass non-Any values, but this is not recommend. If Basic already knows the target type, using the <literal>CreateUnoValue()</literal> function will only lead to additional converting operations that slow down the Basic execution.</paragraph> +<bascode> + <paragraph role="bascode" id="bas_id131677664098930" localize="false">CreateUnoValue(Type As String, Value As Object) As Object </paragraph> +</bascode> + +<embed href="text/sbasic/shared/00000003.xhp#functvalue"/> +<paragraph role="paragraph" id="par_id851677925987795">Object</paragraph> + +<embed href="text/sbasic/shared/00000003.xhp#functparameters"/> +<paragraph role="paragraph" id="par_id561677933999834"> <emph>Type</emph>: The fully qualified Uno type name. Supported data types are <literal>void</literal>, <literal>char</literal>, <literal>boolean</literal>, <literal>byte</literal>, <literal>short</literal>, <literal>unsigned short</literal>, <literal>long</literal>, <literal>unsigned long</literal>, <literal>hyper</literal>, <literal>unsigned hyper</literal>, <literal>float</literal>, <literal>double</literal>, <literal>string</literal>, <literal>type</literal>, and <literal>any</literal>. Names are case sensitive and may be preceded by square brackets to indicate an array.</paragraph> +<paragraph role="paragraph" id="par_id521677934011767"> <emph>Value</emph>: A strictly typed value.</paragraph> +<bascode> + <paragraph role="bascode" id="bas_id111677934830145" localize="false">byte_sequence_object = CreateUnoValue("[]byte", Array(85, 3, 27))</paragraph> +</bascode> + +<embed href="text/sbasic/shared/00000003.xhp#errorcode"/> +<paragraph role="paragraph" id="par_id3150541" xml-lang="en-US">If <literal>CreateUnoValue</literal> cannot convert the value to the specified Uno type, an error occurs. The <literal>com.sun.star.script.Converter</literal> service is responsible for the conversion.</paragraph> + +<embed href="text/sbasic/shared/00000003.xhp#functexample"/> +<paragraph role="paragraph" id="par_id3153524" xml-lang="en-US">This function is intended for use in situations where the default Basic to Uno type converting mechanism is insufficient. This happens calling generic <literal>Any</literal> based API methods, such as <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1beans_1_1XPropertySet.html">com.sun.star.beans.XPropertySet</link><literal>.setPropertyValue()</literal> or <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1container_1_1XNameContainer.html">com.sun.star.container.XNameContainer</link><literal>.insertByName()</literal>. <literal>CreateUnoValue()</literal> sets a value object for the unknown Uno type.</paragraph> + +<paragraph role="paragraph" id="par_id511677928924995">This example uses <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1beans_1_1XPropertySet.html">com.sun.star.beans.XPropertySet</link><literal>.addProperty()</literal> method to create a document property whose default values requires <literal>CreateUnoValue()</literal> usage:</paragraph> +<bascode> + <paragraph role="bascode" id="bas_id791677929198553" localize="false">With ThisComponent.DocumentProperties.getUserDefinedProperties()</paragraph> + <paragraph role="bascode" id="bas_id981677936008973" localize="false"> .addProperty("FOO", com.sun.star.beans.PropertyAttribute.REMOVEABLE, CreateUnoValue("double", 23))</paragraph> + <paragraph role="bascode" id="bas_id181677936010027" localize="false">End With </paragraph> +</bascode> +<paragraph role="paragraph" id="par_id3150769" xml-lang="en-US">You can also use this function to pass non-Any values, but this is not recommended. If Basic already knows the target type, using the <literal>CreateUnoValue()</literal> function will only lead to additional converting operations that slow down the Basic execution.</paragraph> </body> -</helpdocument> +</helpdocument>
\ No newline at end of file diff --git a/source/text/sbasic/shared/03140003.xhp b/source/text/sbasic/shared/03140003.xhp index b9369e8fa9..d4a69e8fde 100644 --- a/source/text/sbasic/shared/03140003.xhp +++ b/source/text/sbasic/shared/03140003.xhp @@ -34,34 +34,34 @@ </bookmark> -<paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03140003.xhp">IRR Function [VBA]</link></paragraph> +<h1 id="hd_id3150499" xml-lang="en-US"><link href="text/sbasic/shared/03140003.xhp">IRR Function [VBA]</link></h1> <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Calculates the internal rate of return for an investment.</paragraph> </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> -<paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">IRR(Values() as Double , [Guess as Variant])</paragraph> +<paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">IRR(ValueArray as Double , [Guess as Variant]) As Double</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">Double</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> -<paragraph id="par_id061420170730135034" role="paragraph" xml-lang="en-US"><emph>Values(): </emph>The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income).</paragraph> -<paragraph id="par_id061420170730137782" role="paragraph" xml-lang="en-US"><emph>Guess</emph> An initial estimate at what the IRR will be.</paragraph> +<paragraph id="par_id061420170730135034" role="paragraph" xml-lang="en-US"><emph>ValueArray</emph>: The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income).</paragraph> +<paragraph id="par_id061420170730137782" role="paragraph" xml-lang="en-US"><emph>Guess</emph>: An initial estimate at what the IRR will be.</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_id06162017021753974" role="bascode" localize="false" xml-lang="en-US">REM ***** BASIC *****</paragraph> -<paragraph id="par_id061620170217534991" role="bascode" localize="false" xml-lang="en-US">Option VBASupport 1</paragraph> -<paragraph id="par_id061620170217535111" role="bascode" localize="false" xml-lang="en-US">Sub ExampleIRR</paragraph> -<paragraph id="par_id061620170217538573" role="bascode" localize="false" xml-lang="en-US"> Dim cashFlow(0 to 3) As Double</paragraph> -<paragraph id="par_id06162017021753515" role="bascode" localize="false" xml-lang="en-US"> cashFlow(0) = -10000</paragraph> -<paragraph id="par_id061620170217538580" role="bascode" localize="false" xml-lang="en-US"> cashFlow(1) = 3500</paragraph> -<paragraph id="par_id061620170217543462" role="bascode" localize="false" xml-lang="en-US"> cashFlow(2) = 7600</paragraph> -<paragraph id="par_id061620170217549769" role="bascode" localize="false" xml-lang="en-US"> cashFlow(3) = 1000</paragraph> -<paragraph id="par_id061620170217542970" role="bascode" localize="false" xml-lang="en-US"> irrValue = IRR(cashFlow) * 100</paragraph> +<paragraph id="par_id06162017021753974" role="bascode" localize="false">REM ***** BASIC *****</paragraph> +<paragraph id="par_id061620170217534991" role="bascode" localize="false">Option VBASupport 1</paragraph> +<paragraph id="par_id061620170217535111" role="bascode" localize="false">Sub ExampleIRR</paragraph> +<paragraph id="par_id061620170217538573" role="bascode" localize="false"> Dim cashFlow(0 to 3) As Double</paragraph> +<paragraph id="par_id06162017021753515" role="bascode" localize="false"> cashFlow(0) = -10000</paragraph> +<paragraph id="par_id061620170217538580" role="bascode" localize="false"> cashFlow(1) = 3500</paragraph> +<paragraph id="par_id061620170217543462" role="bascode" localize="false"> cashFlow(2) = 7600</paragraph> +<paragraph id="par_id061620170217549769" role="bascode" localize="false"> cashFlow(3) = 1000</paragraph> +<paragraph id="par_id061620170217542970" role="bascode" localize="false"> irrValue = IRR(cashFlow) * 100</paragraph> <paragraph id="par_id061620170217548258" role="bascode" xml-lang="en-US"> Print irrValue ' returns 11.3321028236252 . The internal rate of return of the cash flow.</paragraph> -<paragraph id="par_id061620170217544542" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph> +<paragraph id="par_id061620170217544542" role="bascode" localize="false">End Sub</paragraph> </bascode> <section id="relatedtopics"> diff --git a/source/text/sbasic/shared/03150000.xhp b/source/text/sbasic/shared/03150000.xhp index 0df50b1f69..807811c5d9 100644 --- a/source/text/sbasic/shared/03150000.xhp +++ b/source/text/sbasic/shared/03150000.xhp @@ -32,18 +32,18 @@ <bookmark_value>FormatDateTime function</bookmark_value> </bookmark> - <paragraph id="hd_id3150499" role="heading" level="1" xml-lang="en-US"><link href="text/sbasic/shared/03150000.xhp">FormatDateTime Function [VBA]</link></paragraph> + <h1 id="hd_id3150499" xml-lang="en-US"><link href="text/sbasic/shared/03150000.xhp">FormatDateTime Function [VBA]</link></h1> <paragraph id="par_id3151384" role="paragraph" xml-lang="en-US">Applies a date and/or time format to a date expression and returns the result as a string.</paragraph> </section> <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <bascode> - <paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">FormatDateTime (DateExpression as Date [, NamedFormat as Integer])</paragraph> + <paragraph id="par_id3143267" role="bascode" localize="false" xml-lang="en-US">FormatDateTime (Date As Date [, NamedFormat As Integer])</paragraph> </bascode> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> <paragraph id="par_id3150669" role="paragraph" localize="false" xml-lang="en-US">String</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> - <paragraph id="par_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>DateExpression</emph>: The date expression to be formatted.</paragraph> + <paragraph id="par_id240720170117391741" role="paragraph" xml-lang="en-US"><emph>Date</emph>: The date expression to be formatted.</paragraph> <paragraph id="par_id24072017011739895" role="paragraph" xml-lang="en-US"><emph>NamedFormat</emph>: An optional <emph>vbDateTimeFormat</emph> enumeration specifying the format that is to be applied to the date and time expression. If omitted, the value <emph>vbGeneralDate</emph> is used.</paragraph> <paragraph role="heading" id="hd_id811512136434300" level="3" xml-lang="en-US">Date and Time formats (vbDateTimeFormat enumeration)</paragraph> <section id="FormatDateTime_constants"> |