Opened 16 years ago
Closed 16 years ago
#1520 closed Bug (No Bug)
_ArrayAdd doesn't work after _ArrayDelete has removed the last element
| Reported by: | Owned by: | Gary | |
|---|---|---|---|
| Milestone: | Component: | Standard UDFs | |
| Version: | 3.3.4.0 | Severity: | None |
| Keywords: | Cc: |
Description
_ArrayDelete returns an empty string after the last element of an array has been removed. _ArrayAdd will not then work, as the variable is no longer an array.
_ArrayAdd could be simply amended to test for an empty string and assign a one-element array to the variable, possinly using the internal _ArrayCreate function.
Alternatively, if the existing behaviour of not being able to replace an empty string with an array needs to be conserved, _ArrayDelete could be amended to return a special value that could then be detected by _ArrayAdd. I don't know enough about the AutoIt internals to know if such a special value could be crafted that would not clash with existing functionality or cause additional problems to such functions as UBound() which should retain its existing behaviour of returning 0 for an "empty array" special value.
Attachments (1)
Change History (2)
by , 16 years ago
comment:1 by , 16 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
There are numerous things wrong with the suggestion and I don't really view the problem as a bug.

Test case showing that an array which has its last element removed cannot have a new element added