Modify

Opened 17 years ago

Closed 17 years ago

#790 closed Bug (Fixed)

Badly named constant in WindowsConstants.au3

Reported by: monoceres Owned by: J-Paul Mesnage
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, 17 years ago

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, 17 years ago

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 J-Paul Mesnage, 17 years ago

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 J-Paul Mesnage, 17 years ago

Milestone: 3.3.1.0
Owner: set to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed in version: 3.3.1.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


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