Apache OpenOffice (AOO) Bugzilla – Issue 43838
ReDim Preserve fails
Last modified: 2017-05-20 11:29:30 UTC
This is very strange. This code as working on Windows I think, and then when I moved this to Linux, it failed. I am running 2.0 Beta in both places. I can not reverify on windows at the moment because I am at home not at work and I only own a Linux computer for home use.... :-( Sub TestIt Dim oParms1() As New com.sun.star.beans.PropertyValue Ta(oParms1()) Ta(oParms1()) Ta(oParms1()) Dim oParms2() As New com.sun.star.beans.PropertyValue Tb(oParms2()) End Sub Sub TA(oProperties()) Dim iUB As Integer Dim iLB As Integer iUB = UBound(oProperties()) + 1 iLB = LBound(oProperties()) ReDim Preserve oProperties(iLB To iUB) End Sub Sub TB(oProperties()) Dim iUB As Integer iUB = UBound(oProperties()) + 1 REM Array must be dimensioned failure! ReDim Preserve oProperties(LBound(oProperties()) To iUB) End Sub
np->ab
I think this is a duplicate to an older task, but I haven't found it. This is really difficult to fix and there's a workaround -> OOo Later.
ab: According to discussion with sw/kso -> 2.0.3
-> OOo 2.0.4
New priorities -> 2.x
... ran into a similar problem with OO 2.1.0, Win XP SP 2. Test case is here: Sub Main Dim asDum1(5) as String Dim asDum2(2) as String redim preserve asDum2(UBound(asDum1)) 'works lUBound = UBound(asDum2)+1 redim preserve asDum2(lUBound) 'works redim preserve asDum2(UBound(asDum2)+1) 'does not work End Sub
There's some relation to the issue i75443 "Support multiple array indices" -> leave on 2.x for further evaluation
basic and scripting issues now should be assigned to component "scripting"
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
-> OOo Later
Reset assigne to the default "issues@openoffice.apache.org".