Description: Basic function argument names can be used either by position either by name. TypeName() Vartype() argument name should be 'VarName' instead of 'Var' - VBA doc: https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/typename-function https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/vartype-function - libO Basic function signatures: https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/typename-function Steps to Reproduce: Consider the following code: Sub Main Const _Array=8192, _Variant=12 Dim table(_3 To 5) Msgbox "TypeName(table): "&TypeName(var:=table) &Chr(13)& _ "VarType(table)="&Vartype(var:=table) _ ,,"Array of Variant values" End Sub Actual Results: Typename() Vartype() functions return respectively 'Variant()' and 8204 that is _Array+_Variant Expected Results: Typename and Vartype should use 'VarName' instead of 'Var' Reproducible: Always User Profile Reset: No Additional Info: See https://bugs.documentfoundation.org/show_bug.cgi?id=141474 for more information.
Link correction - LibO BASIC function signatures: https://help.libreoffice.org/7.5/en-US/text/sbasic/shared/03103600.html?DbPAR=BASIC#bm_id3143267
Indeed, both TypeName and VarType use "Var" as the argument name. See: https://opengrok.libreoffice.org/xref/core/basic/source/runtime/stdobj.cxx?r=fbaf865f#869 In MS VBA the argument is called varname. This might be a VBA compatibility issue. The code below does not work: Option VBASupport 1 Sub TestVarName Dim a As Integer MsgBox TypeName(varname := a) End Sub
@Alain, do you think that changing this argument name might cause backwards compatibility problems?
(In reply to Rafael Lima from comment #3) > @Alain, do you think that changing this argument name might cause backwards > compatibility problems? Keyword arguments documentation in help in recent - when I introduced BASIC syntax diagrams around 2020 - although discrepancies date from OOo. Such a risk is quite limited, while supporting the same keywords as VBA provides advantages. https://gerrit.libreoffice.org/c/help/+/91506 added in 'keyword arguments' for Call statement. see https://help.libreoffice.org/7.5/en-US/text/sbasic/shared/03090401.html?DbPAR=BASIC#bm_id3154422 tdf#147262 illustrates a recent argument name fix.
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.