Opened on Aug 8, 2022 at 11:38:23 AM
Closed on Aug 17, 2022 at 12:14:00 PM
Last modified on Aug 17, 2022 at 12:32:43 PM
#3906 closed Feature Request (Completed)
GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type
| Reported by: | KaFu | Owned by: | Jpm |
|---|---|---|---|
| Milestone: | 3.3.16.1 | Component: | Documentation |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
Hiho,
again and again I stumble over this variable :). I often use the example 1 as a simple copy&paste starting point for testing.
Now the button control is labeled $idOK, which is also used in <MsgBoxConstants.au3> as a return value.
It's not a problem in local scope, but I often remove the function definition and then $idOK is suddenly in Global scope and collides with the messagebox const.
I would like to propose to rename the variable in the GUICreate() example into something like $c_Button_OK.
Best Regards
Attachments (0)
Change History (9)
comment:2 by , on Aug 8, 2022 at 7:01:47 PM
| Type: | Bug → Feature Request |
|---|
comment:3 by , on Aug 8, 2022 at 7:03:44 PM
For me is not a bug,
The example is working without any Error
I change it to a "feature" request
comment:5 by , on Aug 12, 2022 at 2:24:16 PM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , on Aug 17, 2022 at 12:05:07 PM
In fact I will adapt all examples to have $idOK = $idBtn_OK as the created ctrl is a Button
For example $g_idX = GUICtrlCreateLabel("0", 10, 10, 50)
will be $g_idLbl_X = GUICtrlCreateLabel("0", 10, 10, 50)
to reflect the type of the ctrl created
comment:7 by , on Aug 17, 2022 at 12:11:32 PM
| Summary: | GUICreate example #1 - use of $idOK → GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type |
|---|
comment:8 by , on Aug 17, 2022 at 12:14:00 PM
| Milestone: | → 3.3.15.6 |
|---|---|
| Resolution: | → Completed |
| Status: | assigned → closed |
Added by revision [12849] in version: 3.3.15.6
comment:9 by , on Aug 17, 2022 at 12:32:43 PM
| Milestone: | 3.3.15.6 → 3.3.16.1 |
|---|
Added by revision [12851] in version: 3.3.16.1

Hi all,
Kafu's idea is interesting (renaming this specific variable) but it should start with $id... to be consistent with most examples found in the help file. If you look at the example GUICtrlCreateButton, you'll find variable names like $idButton_Notepad or $idButton_Close
Maybe we could adapt this naming convention to the 1st example found in GUICreate, renaming this annoying $idOK to $idButton_OK ?