Modify

Opened 17 years ago

Closed 17 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 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

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

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


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