Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#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)

in reply to:  description comment:1 by Valik, 17 years ago

Resolution: No Bug
Status: newclosed

Replying to anonymous:

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)

It means there is no documented return value unless one is explicitly set.

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.

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.

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

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.


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.