Modify

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#3815 closed Bug (No Bug)

Remark in help regarding return value of _ArrayDelete is wrong

Reported by: anonymous Owned by:
Milestone: Component: Documentation
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description

The "Remarks" section of the _ArrayDelete function contains the following text regarding the return value (see https://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayDelete.htm):
"[...] but the return value of the function (if successful) gives the new highest row index of the array."
But this statement is not true.
The return value is not the new highest row index, but the total number of rows.
See also the following example.

#include <Array.au3>

Local $aArray[5] = [0, 1, 2, 3, 4]

ConsoleWrite("Number of array elements before deletion: " & UBound($aArray) & @CRLF)
ConsoleWrite("Return value of _ArrayDelete: " & _ArrayDelete($aArray, 2) & @CRLF)
ConsoleWrite("Number of array elements after deletion: " & UBound($aArray) & @CRLF)

Attachments (0)

Change History (2)

comment:1 follow-up: Changed 8 months ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

The doc is not wrong as row index is starting at 1 so the size of the arraay is equal to the highest row index

comment:2 in reply to: ↑ 1 Changed 8 months ago by domenic.laritz@…

Replying to Jpm:

The doc is not wrong as row index is starting at 1 so the size of the arraay is equal to the highest row index

But this is contradictory to the function _ArrayAdd.
There is the same text in the remarks as in _ArrayDelete, but the behavior is different (and in my opinion correct):
_ArrayDelete actually returns the new highest index and not the number of rows!

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.