Modify

Opened 16 years ago

Closed 16 years ago

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

comment:1 in reply to: ↑ description Changed 16 years ago by monoceres

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 Changed 16 years ago by Valik

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 Changed 16 years ago by Jpm

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 Changed 16 years ago by Jpm

  • Milestone set to 3.3.1.0
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version: 3.3.1.0

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 owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.