Label names are NOT unique to a script

Share your ideas as to how the documentation can be improved.
joefiesta
Posts: 498
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Label names are NOT unique to a script

22 Aug 2022, 10:42

at Labels,https://www.autohotkey.com/docs/misc/Labels.htm#syntax-and-usage, it is stated, where their names are defined:
Label names must be unique throughout the whole script.
I believe that to be incorrect.

Multiple labels with the same name may exist in a script in the case of each being a different hotkey definition under a different #IfWinActive (or similar) directive.

I believe it would be more accurately written as:
Normal label names (non-Hotkey and non-Hotstring) must be unique throughout the whole script
User avatar
flyingDman
Posts: 2843
Joined: 29 Sep 2013, 19:01

Re: Label names are NOT unique to a script

22 Aug 2022, 11:34

You might want to give an example to prove your point.
14.3 & 1.3.7
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Label names are NOT unique to a script

22 Aug 2022, 11:44

Code: Select all

gosub q

q::MsgBox no variant

#If false
q::MsgBox false variant
lexikos
Posts: 9688
Joined: 30 Sep 2013, 04:07
Contact:

Re: Label names are NOT unique to a script

01 Sep 2022, 20:54

It would be more correct to clarify that the entire paragraph applies only to normal labels. Hotkey and hotstring "label names" are restricted by the hotkey and hotstring syntax, and not by any of the restrictions noted in that paragraph. The recommendations about style conventions obviously also don't apply.

Return to “Suggestions on Documentation Improvements”

Who is online

Users browsing this forum: No registered users and 6 guests