Summary: | ReDim on user type dynamic array member causes syntax error | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Oguz Meteer <oguz286> |
Component: | BASIC | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | andreas.heinisch, himajin100000, mikekaganski, rafael.palma.lima, sokol, xiscofauli |
Priority: | medium | ||
Version: | Inherited From OOo | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: |
Description
Oguz Meteer
2022-06-08 11:48:01 UTC
I ran a few tests and there seems to be something wrong here indeed. First of all, I made a few corrections to the first example so it would run in Excel VBA as well. So I used the following code: Option VBASupport 1 Type MyTyp a() As String End Type Sub Main() Dim typ As MyTyp ReDim typ.a(0) typ.a(0) = "Hello" MsgBox typ.a(0) End Sub The code above runs fine in Excel VBA (excluding the 'Option VBASupport 1' line). It prints "Hello" as expected. However in LibreOffice it gives a syntax error, meaning it doesn't compile. It seems LO can't recognize "typ.a" as a symbol. The following code runs fine in LO and MSO: Sub Main2() Dim typ As MyTyp Dim aTemp() As String Redim aTemp(0) As String typ.a = aTemp typ.a(0) = "Hello" MsgBox typ.a(0) End Sub This indicates that there's some problem with syntax check for the ReDim command which does not accept user-defined types as symbols. I'm setting this to NEW. @Mike, maybe you have an opinion about this issue? System info: Version: 7.3.3.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Ubuntu package version: 1:7.3.3~rc2-0ubuntu0.21.10.1~lo1 Calc: threaded (In reply to Rafael Lima from comment #1) I totally agree with your analysis. |