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.
The current Help page reflects the LibreOffice Basic implementation of the MsgBox instruction or function.
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_),
(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 !
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.
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
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
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
Thank you very much, colleagues!
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
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
Thanks again!
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
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
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
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
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
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
Is this bug report ready to close?
I'll try to double check in the next few days. :)
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 …
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!
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
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.
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
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
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
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.
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
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
@Vladimir I have covered all Basic functions that required signature correction. Please advise any omissions. Please close if Ok your side.
Alain, thank you so much for the important work you've done! Unfortunately, I did not see the previous message, I apologize.