Modify

#790 closed Bug (Fixed)

Badly named constant in WindowsConstants.au3

Reported by: monoceres Owned by: Jpm
Milestone: 3.3.1.0 Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: constants $error Cc:

Description

Not really a "bug" but I don't think that declaring $ERROR as const in WindowsConstants.au3 is a very good idea, since you then cannot use variables named $error, which is a very common name to name variables.
Just my 2 cents, it sure did cause me some headaches.

Attachments (0)

Change History (4)

in reply to:  description comment:1 by monoceres, on Jan 26, 2009 at 4:44:43 PM

Replying to monoceres:

Not really a "bug" but I don't think that declaring $ERROR as const in WindowsConstants.au3 is a very good idea, since you then cannot use variables named $error, which is a very common name to name variables.
Just my 2 cents, it sure did cause me some headaches.

I also found this, not very good constant names either:

Global Const $TRANSPARENT = 1
Global Const $OPAQUE = 2

comment:2 by Valik, on Jan 26, 2009 at 6:57:22 PM

Off the top of my head I'm not sure what $ERROR would be used for. However, the constants $TRANSPARENT and $OPAQUE really are the names of Windows API constants so I don't think we should change them.

comment:3 by Jpm, on Jan 27, 2009 at 9:04:49 AM

In fact this naming come from MSDN.
MS could have named it as the others ERRORREGION.
Perhaps we can change it as it use only when using _WinAPI_CombineRgn() or _WinAPI_GetWindowRgn()
The "problem" is the same for TRANSPARENT and OPAQUE in _WinAPI_Get/SetBkMode()

PS your headaches could have been little less when using Opt("MustDeclareVars",1)

comment:4 by Jpm, on Feb 1, 2009 at 12:15:06 PM

Milestone: 3.3.1.0
Owner: set to Jpm
Resolution: Fixed
Status: newclosed

Fixed in version: 3.3.1.0

Modify Ticket

Action
as closed The owner will remain Jpm.

Add Comment


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