Modify

Opened 10 years ago

Closed 10 years ago

#3140 closed Feature Request (Fixed)

@error Description

Reported by: mLipok Owned by:
Milestone: Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

here:
https://www.autoitscript.com/autoit3/docs/function_notes.htm

Please consider better describe the significance and usage of the keyword @error

Especialy

@error = 0 ;is always success

should be worded like this

@error = 0 ; always means success

ps.
I do not do it myself, because of my still poor knowledge of English

REASON/FORUM LINK:
https://www.autoitscript.com/forum/topic/177987-error-using-ielinkclickbytext/

Attachments (0)

Change History (6)

comment:1 by TicketCleanup, 10 years ago

Version: 3.3.15.0

Automatic ticket cleanup.

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

I don't know who wrote this page but it can be Jon himself since the wording is the same as in the first introduction in 2006
I am not either an English corrector so Just wait English fluent people validate the proposal

comment:3 by Melba23, 10 years ago

How does this read?

Success/failure indication

Some functions use the Return value to indicate success/failure, others set the @error flag. Some do both....

If the Return value method is used, there is no defined value for the return but it is typically non-zero for success to allow easy to read code...

If SomeUserFunc() Then ;...function worked.
If Not SomeUserFunc() Then ;...function failed.

If the @error flag method is used, @error = 0 always indicates success. Other values are as defined in the Help file for the specific function.

Local $sFileRead = FileReadLine("C:\someFile.txt")
If @error = -1 Then ; End-of-file was reached. 

If a function uses the @error flag method, you should always check the flag before attempting to use the return value - if the flag is set then the function return value is generally undefined...

M23

comment:4 by mLipok, 10 years ago

one problem in reading and my understanding:

If the Return value method is '''used''' , there is no defined value for the return but...

is this intentional or this should be not used ?

Other values are as defined in the Help file for the specific function.

additional description proposal:

Other values are as defined in the Help file for the specific function, but always @error > 0 should mean that something went wrong.

Additional description proposal:

By using @extended function can show to the user additional information, for example parameter number which fires @error.
Version 0, edited 10 years ago by mLipok (next)

comment:5 by Melba23, 10 years ago

mLipok,

There is no "defined" value in the sense that the value is dependent on the function itself - each one may have a different value. But I see what you mean - the advantage of having non-native speakers to check the wording!

Would it be better if it read:

If the Return value method is used, each function will specify in the Help file the specific return value for success - but the value is typically non-zero to allow easy to read code...

I do not believe that referring to @extended is useful here - it is only likely to confuse as many functions do not use it.

M23

comment:6 by Melba23, 10 years ago

Resolution: Fixed
Status: newclosed

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.