[Libreoffice-bugs] [Bug 138155] New: "CallByName" does not work when argument or returned value is an array

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Nov 12 09:57:01 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=138155

            Bug ID: 138155
           Summary: "CallByName" does not work when argument or returned
                    value is an array
           Product: LibreOffice
           Version: 7.0.2.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: jp at ledure.be

Description:
The CallByName builtin function allows for the dynamic execution of a method
given by its name.
The arguments of CallByName are:
1. The Basic object on which to apply the method
2. The name of the method as a string
3. The call type (1 for a usual method)
4+. The effective arguments of the method

When one of the arguments (4+) is an array, then next error is raised:
BASIC runtime error. Incorrect property value.

The same error is raised when the value returned by the called method is itself
an array.

For any other variable type, including a Basic  object, a user-defined type,
etc, CallByName works fine.

Steps to Reproduce:
1. In the Basic IDE, store next code in module Module1 of any (may be empty) LO
document:
Option Explicit
Option Compatible
Sub TestCallByNameArray()
Dim a,b,c,d,e,f,g
Const vbGet = 2, vbLet = 4, vbMethod = 1, vbSet = 8
        Set a = Module2
        b = Array(1,2,3)        
        c = CallByName(a, "SomeMethod", vbMethod, b)
End Sub

2. Store next code in Module2 of the same document:
Function SomeMethod(arr as Variant) As Variant
        SomeMethod = arr
End Function

3. Run the TestCallByNameArray() Sub


Actual Results:
"BASIC runtime error. Incorrect property value." on the line:
c = CallByName(a, "SomeMethod", vbMethod, b)


Expected Results:
The variable "c" should contain the output of the called function, i.e.
Ayyar(1,2,3).


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.2.2
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 6; OS: Linux 5.4; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201112/723d5353/attachment.htm>


More information about the Libreoffice-bugs mailing list