I was told that the number of digits inside a hex number should be represented as a multiple of 2.
Both 0xA and 0x0A are representations of decimal 10, but only the second notation (0x0A) is really correct (at my personal opinion, of course).https://simple.wikipedia.org/wiki/Hexadecimal:
In computer jargon four bits make a nibble. A nibble is one hexadecimal digit, written using a symbol 0-9 or A-F. Two nibbles make a byte (8 bits).
https://softwareengineering.stackexchange.com/a/415198:
You write 0A, not A or 00A even though they are technically the same number.
Documentation uses the first one (0xA). It may be easier to eyes, but on the other hand it may be considered as inaccurate.
Some examples:
Code: Select all
; https://www.autohotkey.com/docs/commands/PostMessage.htm
SendMessage, 0xC, 0, &MyVar, ClassNN, WinTitle ; 0XC is WM_SETTEXT
; would be better:
SendMessage, 0x0C, 0, &MyVar, ClassNN, WinTitle ; 0x0C is WM_SETTEXT
Code: Select all
; https://www.autohotkey.com/docs/commands/DllCall.htm:
FILE_SHARE_WRITE := 0x2
; would be better:
FILE_SHARE_WRITE := 0x02