Bug 141474 - Documentation specifies incorrect parameter names for Basic functions
Summary: Documentation specifies incorrect parameter names for Basic functions
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0 target:7.3.0 target:7.4....
Keywords:
Depends on: 147262
Blocks: Macro-StarBasic
  Show dependency treegraph
 
Reported: 2021-04-03 13:49 UTC by Vladimir Sokolinskiy
Modified: 2023-11-10 12:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2021-04-03 13:49:10 UTC
The parameters of Basic functions are named; in the documentation, in many cases, parameter names are specified incorrectly.

For example, for the Msgbox function, the documentation states that the function has parameters:

MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) 


In fact, the function has parameters with the same name as the similar Excel function. Basic script:

Sub test
  Msgbox Prompt:="Prompt", Buttons:=MB_ICONSTOP, Title:="Documentation"
End Sub


In my opinion, it is necessary in the documentation to clarify the names of the parameters in this and similar cases.
Comment 1 Olivier Hallot 2021-04-08 14:43:14 UTC
The current Help page reflects the LibreOffice Basic implementation of the MsgBox instruction or function.
Comment 2 Vladimir Sokolinskiy 2021-04-08 18:41:15 UTC
The parameter names of the LibreOffice Basic Msgbox function are described [url=https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.cxx?r=fbaf865f#610]here[/url] (as far as I understand). 

arg(u"Prompt",   SbxSTRING),
arg(u"Buttons",  SbxINTEGER, OPT_),
arg(u"Title",    SbxSTRING,  OPT_),
arg(u"Helpfile", SbxSTRING,  OPT_),
arg(u"Context",  SbxINTEGER, OPT_),
Comment 3 Alain Romedenne 2021-04-09 08:20:04 UTC
(In reply to Vladimir Sokolinskiy from comment #2)
> The parameter names of the LibreOffice Basic Msgbox function are described
> [url=https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.
> cxx?r=fbaf865f#610]here[/url] (as far as I understand). 
> 
> arg(u"Prompt",   SbxSTRING),
> arg(u"Buttons",  SbxINTEGER, OPT_),
> arg(u"Title",    SbxSTRING,  OPT_),
> arg(u"Helpfile", SbxSTRING,  OPT_),
> arg(u"Context",  SbxINTEGER, OPT_),

Correct !
Comment 4 Alain Romedenne 2021-04-09 08:31:11 UTC
As a minimum help pages should document the exact names for arguments that are actually implemented. As for MsgBox function implemented parameter names are: prompt, buttons and title.
Comment 5 Commit Notification 2021-04-14 07:35:10 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/a26e51cc4e5af7eae340fcf20e31e991239def2d

tdf#141474 MsgBox function signature
Comment 6 Commit Notification 2021-04-14 11:29:25 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/f1c3329df60dd8e0d5fb495a1e2f12790eb7a829

tdf#141474 InputBox Basic method signature
Comment 7 Commit Notification 2021-05-05 23:02:38 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/f9a2226309678e6a8769af6d312f796bb6835c4b

tdf#131368, tdf#141474 Document WeekDay Basic function
Comment 8 Vladimir Sokolinskiy 2021-05-06 10:35:34 UTC
Thank you very much, colleagues!
Comment 9 Commit Notification 2021-06-10 13:08:56 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/e5ac483bab252537ccbd087e6a133230cb8bae70

tdf#141474 tdf#124066 Basic keyword arguments explanations
Comment 10 Commit Notification 2021-11-10 19:23:12 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/b902fbcc87b0baf76b3dd501f0feff40bb1f3711

tdf#141474 Atn, Cos, Sin, Tan function signatures
Comment 11 Vladimir Sokolinskiy 2021-11-10 19:24:29 UTC
Thanks again!
Comment 12 Commit Notification 2021-11-16 13:15:22 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/eb45e7df8aeeab7791876038c16345d5321e49b1

tdf#141474 Asc, AscW function signatures
Comment 13 Commit Notification 2021-12-02 19:32:45 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/3b63a6a4d3e61d57c552051037f69b8cdbac167b

tdf#141474 CBool, CByte, CCur function signatures
Comment 14 Commit Notification 2022-01-26 20:32:34 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/2f76d8e9280cbe1e726cfcf2d4a798c8cf418241

tdf#145693 tdf#141474 Chr ChrW method signatures
Comment 15 Commit Notification 2022-02-18 00:17:59 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/401fb641aff217c7c333ce71d22abcf575d3ed09

tdf#114263 tdf#141474 tdf#147262 CallByName() function new help page
Comment 16 Commit Notification 2022-05-09 15:44:39 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/084d84f09882ec35007ad4566247932a30899799

tdf#141474 tdf#148466 Choose function accepts keyword arguments
Comment 17 Commit Notification 2022-05-19 14:22:48 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/f3b76b5e8d644176704c4619304278869ae57127

tdf#141474 Cdbl, Cint, Clng, Csng accept keyword arguments
Comment 18 Martin Srebotnjak 2022-10-13 10:06:28 UTC
Is this bug report ready to close?
Comment 19 Vladimir Sokolinskiy 2022-10-13 11:27:14 UTC
I'll try to double check in the next few days. :)
Comment 20 Alain Romedenne 2022-10-14 17:04:45 UTC
Most patches were performed following functions alphabetic order.

If I'm not mistaken many function help pages remain tobe modified. To name a few:
 …
- FormatDateTime
  …
-InStr, InStrRev
 …
Comment 21 Vladimir Sokolinskiy 2022-10-15 13:47:58 UTC
Below is a list of functions that have more than one parameter and that have at least one invalid parameter name.

CallByName
CreateUnoListener
CreateUnoValue
Dir
FileAttr
FileCopy
FormatDateTime
Iif
InStr
InStrRev
IRR
Join
Left
Mid
MIRR
NPV
Partition
Right
SetAttr
Shell
Split
StrComp
StrConv
String

Thanks to the developers for the changes already made!
Comment 22 Alain Romedenne 2022-10-21 11:38:57 UTC
CallByName is correct as per latest stdobj.cxx source file:
https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.cxx?r=98f88ac1

cf. tdf#147262 fix from 7.3 onwards - see comment 15
Comment 23 Vladimir Sokolinskiy 2022-10-21 12:39:12 UTC
Yes, I'm sorry, the function CallByName documentation is OK.

Sub TestCallByName
   Msgbox CallByName(Object:=ThisComponent, ProcName:="Title", CallType:=2)    
End Sub

shows the title of the document.
Comment 24 Commit Notification 2022-10-25 14:33:48 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/b122dcc35b2015c8ffd0f826dd99edfeeebb39d1

tdf141474 CreateUnoListener function accepts keyword arguments
Comment 25 Commit Notification 2022-10-30 13:33:21 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/021a444733a8022967b374642057d2032318634b

tdf141474 CreateUnoService accepts keyword arguments
Comment 26 Commit Notification 2022-11-07 00:14:45 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/3568ffd245094b1ee98eab3cb2e0be18646a7aa5

tdf141474 Typename, Vartype functions accept keyword arguments
Comment 27 Commit Notification 2023-02-26 16:15:05 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fd19bc83cfd49937da8585b9ab938b2086ecf74a

tdf#141474 tdf#151901 BASIC functions argument names do not match that of VBA

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2023-03-06 12:23:37 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/6f339f367d1ee6aa8d13b41eaf3ca19bca9926e6

tdf#141474 Incorrect parameter names for Basic functions in help
Comment 29 Commit Notification 2023-03-13 17:49:58 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/f3a16adcb0187df5cf9c01ae6b4550785c03375b

tdf#141474 Incorrect parameter names for Basic functions in help
Comment 30 Alain Romedenne 2023-03-16 15:42:54 UTC
@Vladimir

I have covered all Basic functions that required signature correction. Please advise any omissions.

Please close if Ok your side.
Comment 31 Vladimir Sokolinskiy 2023-11-10 12:00:18 UTC
Alain, thank you so much for the important work you've done!

Unfortunately, I did not see the previous message, I apologize.