Modify

Opened 9 years ago

Closed 9 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 Changed 9 years ago by TicketCleanup

  • Version 3.3.15.0 deleted

Automatic ticket cleanup.

comment:2 Changed 9 years ago by Jpm

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 Changed 9 years ago by Melba23

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 Changed 9 years ago by mLipok

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.

and some other Additional description proposal:

By using @extended function can show to the user additional information, for example parameter number which fires @error.
Last edited 9 years ago by mLipok (previous) (diff)

comment:5 Changed 9 years ago by Melba23

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 Changed 9 years ago by Melba23

  • Resolution set to Fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.