Modify

Opened 12 years ago

Last modified 2 years ago

#2793 assigned Feature Request

SetError And SetExtended not integer value

Reported by: anonymous Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

Therefore in 3.3.13.1 autoit beta, developers have managed to return in @extended macro not a number, it can be seen in the function FileFindNextFile.

(Return a string in @extended in the same format as FileGetAttrib())

Therefore the question.
Can be improved SetError And SetExtended function so that the returns are not just a number.

Attachments (0)

Change History (9)

comment:1 by TicketCleanup, 12 years ago

Version: 3.3.12.0

Automatic ticket cleanup.

comment:2 by czardas, 12 years ago

I don't really see a reason to change behaviour if an integer value suffices. Other than having to reference the meaning of an error, or extended, value; there is no further inconvenience. There are already many ways to create multiple return values, which perhaps ought to be prefered over any additional internal complexity. Advise me if I'm wrong.

comment:3 by anonymous, 12 years ago

There are already many ways to create multiple return values

but what prevents little change seterror? Then it will be possible to write such elegant things as:

Return SetError(0, 'MB', 1024)
Return SetError(0, 'PTR', $DATA)
Return SetError(0, 'CDROM', 'F:')
Return SetError(0, 'YYYYMMDD' 20140811)

Instead of using Byref, Global, Array ...

comment:4 by czardas, 12 years ago

As things are, it is neither necessary to use ByRef nor a global array. The code I posted in the following topic demonstrates this.

http://www.autoitscript.com/forum/topic/163429-can-extended-be-a-string/?p=1190642

I question the need for a change, but I also appreciate the previous poster's concept.

comment:5 by anonymous, 12 years ago

extended so it is called, so you can return additional information from the function, and why it should only be a number, it is not clear!

comment:6 by BrewManNH, 11 years ago

Microsoft decided long ago that error codes would be numeric. No one seems to mind that, so I don't understand why you'd expect AutoIt to do something like this.

comment:7 by Melba23, 11 years ago

Personally, I think this would be a good addition to the language. We are talking about @extended and not @error so I do not find the "MS numeric error code" argument particularly convincing. Being able to pass strings as well as numbers could be very useful.

And Jon has only himself to blame for having implemented the FileFindNextFile @extended return in that way - if he had stuck to a numeric value (as is returned by the API) the question would not have arisen!

M23

comment:8 by J-Paul Mesnage, 6 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

Hi,
Fix sent to Jon

comment:9 by J-Paul Mesnage, 2 years ago

Owner: changed from J-Paul Mesnage to Jon

Modify Ticket

Action
as assigned The owner will remain Jon.

Add Comment


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