Modify ↓
#1123 closed Bug (No Bug)
SetError(), SetExtended(), default return value.
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Milestone: | Component: | Documentation | |
Version: | 3.3.1.1 | Severity: | None |
Keywords: | SetError SetExtended Return | Cc: |
Description
Documentation for both SetError and SetExtended() 'Return Value' say "By default, none, ...".
Assuming "none" stands for or just zero.
But both return 1 when used without a Return value.
ConsoleWrite('SetError(2) = ' & SetError(1) & @CRLF) ConsoleWrite('SetExtended(2) = ' & SetExtended(1) & @CRLF)
ps: A additional remark to SetExtended() about the fact that it not just sets @extended, but also resets @error back to zero, might be usefull.
Attachments (0)
Change History (2)
comment:1 in reply to: ↑ description Changed 15 years ago by Valik
- Resolution set to No Bug
- Status changed from new to closed
comment:2 Changed 15 years ago by Jpm
Just read the Functions Notes
When the documentation states that the return value = none, AutoIt always returns a value to avoid errors. 1 is usually the value returned, but you should not depend on this return value.
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.
Note: See
TracTickets for help on using
tickets.
Replying to anonymous:
It means there is no documented return value unless one is explicitly set.
Every single function resets @error when it's called. There are no exceptions. That is a documented feature. Also documented is that SetExtended() should only be used if its only necessary to set @extended. Otherwise SetError(<error>, [extended]) should be used.
In other words, nothing to see here.