Modify

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: snarks@… 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)

test.au3 (147 bytes ) - added by snarks@… 16 years ago.
Test case showing that an array which has its last element removed cannot have a new element added

Download all attachments as: .zip

Change History (2)

by snarks@…, 16 years ago

Attachment: test.au3 added

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

comment:1 by Valik, 16 years ago

Resolution: No Bug
Status: newclosed

There are numerous things wrong with the suggestion and I don't really view the problem as a bug.

Modify Ticket

Action
as closed The owner will remain Gary.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.