ReDim to empty does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenOffice |
Invalid
|
Undecided
|
Unassigned | ||
libreoffice (Ubuntu) |
Expired
|
Undecided
|
Unassigned | ||
openoffice.org (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: openoffice.org
ReDim (and Dim) throw a run-time error if UpperBound = (LowerBound-1).
For example
Dim foo(0 to 9)
...
ReDim foo(0 to -1) 'causes error
This should not be an error, but should make the array contain zero elements.
Note that arrays can be declared as empty with
Dim foo()
which has the save effect as ReDim foo(0 to -1) [except that it works...].
However that form does not allow easy use in algorithms which compute array bounds at run-time and may validly want to result an empty array.
DEMO: See attached file.
For example
sub RemoveLastEleme
ReDim Preserve ary(LBound(ary) to UBound(ary)-n)
end sub
... should work for for n up to and including the total number of elements, but instead you currently have to code it like this:
sub RemoveLastEleme
if UBound(
ReDim Preserve ary(LBound(ary) to UBound(ary)-n)
else
ReDim ary()
end if
end sub
ProblemType: Bug
Architecture: amd64
Date: Wed Nov 4 14:25:11 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/lib/
Package: openoffice.org-core 1:3.1.1-5ubuntu1 [modified: var/lib/
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: openoffice.org
Uname: Linux 2.6.31-14-generic x86_64
---
Architecture: amd64
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
Package: openoffice.org-calc 1:3.2.0-7ubuntu4
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
Tags: lucid
Uname: Linux 2.6.32-22-generic x86_64
UserGroups: adm admin audio cdrom dialout dip fax floppy fuse games lpadmin netdev plugdev sambashare tape users vboxusers video
tags: | added: karmic |
summary: |
- ReDim to empty does not work + [upstream] ReDim to empty does not work |
Changed in openoffice.org (Ubuntu): | |
status: | Incomplete → Triaged |
Changed in openoffice.org (Ubuntu): | |
status: | Triaged → Won't Fix |
Changed in libreoffice (Ubuntu): | |
status: | Incomplete → New |
[This is an automatic notification.]
This bug was reported against an earlier version of Ubuntu, can you test if it still occurs on Ubuntu 10.04 LTS (Lucid Lynx)?
Please note we also provide technical support for older versions of Ubuntu, but not in the bug tracker. Instead, to raise the issue through normal support channels, please see:
http:// www.ubuntu. com/support
If you are the original reporter and can still reproduce the issue on Lucid, please run the following command to refresh the report:
apport-collect 474844
Bear in mind that you may need to install the python-launchpadlib package from the universe repository. Additionally, when prompted to give apport-collect permissions for Launchpad you will need to give it at least the ability to "Change Non-Private" data as it will be adding information to your bug report.
If you are not the original reporter, please file a new bug report, so we can work with you as the original reporter instead (you can reference bug 474844 in your report if you think it may be related):
ubuntu-bug openoffice.org
If by chance you can no longer reproduce the issue on Lucid or if you feel it is no longer relevant, please mark the bug report 'Fix Released' or 'Invalid' as appropriate, at the following URL:
https:/ /bugs.launchpad .net/ubuntu/ +bug/474844