Modify

Opened 11 years ago

Closed 11 years ago

#652 closed Bug (No Bug)

_FileListToArray() does not returnarray if no file s found

Reported by: RickJ Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: None
Keywords: Cc:

Description

if _FileListToArray() doesn't find any files it does not return an array. It should probably return an array of one or two elements with the first element having a value of zero.

Currently @error is set to a value of 4 to indicate no files found so it's possible to workaround this. IMHO a function should always return the same data type.

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by Valik

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

Assuming you are writing correct code, then the fact that it doesn't return an array on error is a non-issue. In fact proper code doesn't even have to check @error. Proper code would resemble:

Local $a = _FileListToArray()
For $i = 1 To UBound($a) - 1
Next

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.