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

            Bug ID: 174432
           Summary: A fixed-size array is deallocated.
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
see https://ask.libreoffice.org/t/vba-calc-erase/139021

Steps to Reproduce:
1.Run macro
Sub array2
    Dim k as integer
    Dim mytotal(1 to 3) as double
    mytotal(1) = 4: mytotal(2) =5: mytotal(3) =6

    MsgBox mytotal(1) & "  " & mytotal(2) & "  " & mytotal(3)

    erase mytotal

    for k=1 to 3
        mytotal(k) = k
    next k
    MsgBox mytotal(1) & "  " & mytotal(2) & "  " & mytotal(3) ' <--This
End sub


Actual Results:
3 3 3

Expected Results:
1 2 3


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 26.8.2.2 (X86_64)
Build ID: 9dea406ab7695df6325b11b0e19fdca8db4b7276
CPU threads: 8; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster;
VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded

If using "Option VBASupport 1", it works.

The help documentation states the following.
> Erases the contents of array elements of fixed size arrays, and releases the 
> memory used by arrays of variable size.
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03104700.html?DbPAR=BASIC#bm_id624713

Either the behavior needs to be corrected, or the documentation needs to be
updated.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to