https://bugs.documentfoundation.org/show_bug.cgi?id=149489
Bug ID: 149489
Summary: ReDim on user type dynamic array member causes syntax
error
Product: LibreOffice
Version: 7.3.3.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Description:
Dear devs,
Based on the discussion
(https://ask.libreoffice.org/t/redim-on-custom-type-containing-dynamic-array/78402/2)
I was advised to report the following bug.
The folowing code works in Excel VBA:
Option VBASupport 1
Type MyTyp
a() as String
End Type
Sub Main
Dim typ as New MyTyp
ReDim typ.a(0)
typ.a(0) = "Hello"
Print(typ.a(0))
End Sub
But it gives me the following error: "BASIC syntax error. Expected: ,." on the
line with the ReDim statement.
The following also works in Excel VBA:
Option VBASupport 1
Type MyTyp
a() as String
End Type
Sub Main
Dim typ as New MyTyp
With typ
ReDim .a(0)
.a(0) = "Hello"
End With
Print(typ.a(0))
End Sub
But this gives me the following error: "BASIC syntax error. Symbol expected."
on the line with the ReDim statement.
In both cases it should print "Hello". I have not tried this on other versions
but I found posts related to this going back to earlier Open Office versions.
Steps to Reproduce:
1. Type either of the two snippets in the post in a Libreoffice Calc macro
2. Run the macro.
Actual Results:
The first macro gives me an error: "BASIC syntax error. Expected: ,."
The second macro gives me an error: "BASIC syntax error. Symbol expected."
Expected Results:
Both should print "Hello"
Reproducible: Always
User Profile Reset: Yes
OpenGL enabled: Yes
Additional Info:
Version: 7.3.3.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 8; OS: Linux 5.18; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
7.3.3-3
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.