Issue 43838 - ReDim Preserve fails
Summary: ReDim Preserve fails
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Linux, all
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-02 03:18 UTC by andrew
Modified: 2017-05-20 11:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description andrew 2005-03-02 03:18:32 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
Comment 1 noel.power 2005-03-02 08:18:33 UTC
np->ab

Comment 2 ab 2005-03-24 11:20:18 UTC
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.
Comment 3 ab 2006-03-07 13:48:31 UTC
ab: According to discussion with sw/kso -> 2.0.3
Comment 4 ab 2006-04-28 11:09:57 UTC
-> OOo 2.0.4
Comment 5 ab 2006-06-20 10:21:35 UTC
New priorities -> 2.x
Comment 6 ms7777 2006-12-29 14:53:06 UTC
... 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
Comment 7 ab 2007-11-16 13:29:36 UTC
There's some relation to the issue i75443 "Support multiple array indices"
-> leave on 2.x for further evaluation
Comment 8 Mathias_Bauer 2007-12-04 14:57:32 UTC
basic and scripting issues now should be assigned to component "scripting"
Comment 9 Martin Hollmichel 2007-12-07 12:13:31 UTC
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Comment 10 ab 2011-01-13 09:58:59 UTC
-> OOo Later
Comment 11 Marcus 2017-05-20 11:29:30 UTC
Reset assigne to the default "issues@openoffice.apache.org".