Defintion of ALPHABETIC

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

Defintion of ALPHABETIC

Post by joefiesta » 01 Dec 2022, 16:22

What is ALPHABETIC mean?

The "IS var ALPHA" "IF var ALPHA" command reports if a character (string?) is ALPHABETIC. But, what is ALPHABETIC exactly. Many of the characters in the range xC0-xFF are alphabetic characters. They are not symbols, numbers, punctutation or anything else.

I think ALPHABETIC needs to be defined more exactly.
Last edited by joefiesta on 04 Dec 2022, 09:54, edited 1 time in total.

neogna2
Posts: 591
Joined: 15 Sep 2016, 15:44

Re: Defintion of ALPHABETIC

Post by neogna2 » 01 Dec 2022, 17:31

I think it means the english alphabet's 26 characters in upper and lower case. In other words the ranges a-z and A-Z.
For example the german ü is not included.

Code: Select all

x := "ü"
if x is alpha
    MsgBox 1 ;not reached
It looks like AutoHotkey reuses the terms alpha and alnum from C++
https://cplusplus.com/reference/cctype/isalpha/
https://cplusplus.com/reference/cctype/isalnum/

If the above is true then the v1 if var is doc could after
True if Var is empty or contains only alphabetic characters
append
(a-zA-Z in the english alphabet)

And similarly in v2 Is doc after
True if Value is a string and is empty or contains only alphabetic characters
append
(a-zA-Z in the english alphabet)

guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Defintion of ALPHABETIC

Post by guest3456 » 01 Dec 2022, 20:45

neogna2 wrote:
01 Dec 2022, 17:31
It looks like AutoHotkey reuses the terms alpha and alnum from C++
https://cplusplus.com/reference/cctype/isalpha/
but according to this link, it returns based on the system locale. so if you changed to German locale, would the code then return true?

in either case, more explicit definition is always better


lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Defintion of ALPHABETIC

Post by lexikos » 02 Dec 2022, 18:01

Links to C standard functions are irrelevant. This is not C.
[v1.0.90+]: The system locale is ignored unless StringCaseSense Locale has been used.
Source: If Var is Type - Syntax & Usage | AutoHotkey
https://github.com/Lexikos/AutoHotkey_L-Docs/commit/11558d1b

Post Reply

Return to “Suggestions on Documentation Improvements”