You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/01/31 13:05:12 UTC
[Bug 124154] REDIM fails with UBOUND or LBOUND of same array
https://issues.apache.org/ooo/show_bug.cgi?id=124154
--- Comment #1 from j.tronel@hotmail.fr ---
Oops, sorry :
Hello,
This code fails, with/without Preserve (Object variable not set):
Sub Main
a = Array(1,2,3)
Redim a(LBound(a)+1 To UBound(a)+2)
End Sub
OK, there's a simple workaround:
Sub Main
a = Array(1,2,3)
lb = LBound(a)+1
ub = UBound(a)+2
Redim a(lb To ub)
End Sub
or using another Sub :
Sub Redim1(myArray,lb,ub,withPreserve As Boolean)
If withPreserve Then
Redim Preserve myArray(lb To ub)
Else
Redim myArray(lb To ub)
End If
End Sub
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.