I noticed in the forum ago sample scripts that some are case sensitive while others are not. So I see
Send "{Enter}"
and
send "{enter}"
This is confusing. Are variables case sensitive, or verbs, or keywords, or all of the above?
Thank you folks! You guys give great information.
Case Sensitivity
-
- Posts: 7
- Joined: 19 Mar 2024, 16:23
Re: Case Sensitivity
Function names and key names (like all the above), variable names, labels, window groups, classes, properties and methods are case-insensitive (at least for Ascii letters, for non-ascii letters see below). Afaics, case-sensitivity is only used moderately in AHK v1 and v2.
Yet Wintitles and string keys in v2 Map objects are case-sensitive by default, and probably other things where it is explicitly noted in the docs (for example, explicitly case-sensitive operators like == and !== versus their case-insensitive counterparts = and !=).
Other things like sorting or StrCompare can be made case-sensitive with certain non-default options.
Generally, a quick test or look into the docs can answer most questions, if in doubt.
About names in general:
Yet Wintitles and string keys in v2 Map objects are case-sensitive by default, and probably other things where it is explicitly noted in the docs (for example, explicitly case-sensitive operators like == and !== versus their case-insensitive counterparts = and !=).
Other things like sorting or StrCompare can be made case-sensitive with certain non-default options.
Generally, a quick test or look into the docs can answer most questions, if in doubt.
About names in general:
PS: Please don't post the same message several times. As a new user, you are required to wait until your posts get approved. Please be patient if this takes some time. Thank you!https://www.autohotkey.com/docs/v2/Concepts.htm#names wrote: Case sensitivity: None for ASCII characters. For example, CurrentDate is the same as currentdate. However, uppercase non-ASCII characters such as 'Ä' are not considered equal to their lowercase counterparts, regardless of the current user's locale. This helps the script to behave consistently across multiple locales.
Re: Case Sensitivity
I would like to clarify that only the window title of a WinTitle is case-sensitive. In addition, regular expressions are always case-sensitive by default unless specified otherwise.
Re: Case Sensitivity
@mikeyww, good point. Thank you
Re: Case Sensitivity
ahk_class is also case-sensitive, even without RegEx.mikeyww wrote:I would like to clarify that only the window title of a WinTitle is case-sensitive.
Re: Case Sensitivity
I stand corrected! Never knew that. I am adding a suggestion to the documentation board for this information to be added.
Who is online
Users browsing this forum: alawsareps, aleksbor, Descolada, reborn, vmech and 132 guests