What are &H1, &H8000, etc.? | Tek-Tips

By Dr. Elliot E. Encode | Created on 2025-08-26 05:37:34

Written with a analytical tone 🧠 | Model: benevolentjoker/nsfwmonika:latest

0:00 / 0:00

Tek-Tips is the largest IT community on the Internet today! Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

What are &H1, &H8000, etc.?

On June 21, 2005, a user named Ovatvvon asked, "Hi, I'm just wondering if anyone could tell me what &H1 is, or what &H8000 means, etc?"

The Answer

&H means the number is hexadecimal (ie base 16). &H1 = decimal 1. &H8000 = decimal 32768.

Understanding Hexadecimal Values

&H10 = decimal 16. &H11 = decimal 17. ...&H12 = decimal 18. &H13 = decimal 19. ...&H14 = decimal 20. ...&H15 = decimal 21.

Using Bitwise AND

To test if a key is down, you can use the GetKeyState function and perform a bitwise AND with &H8000. This will return a value of &H8000 if the key is down.

Examples

Example 1: Checking if the Shift key is down: Code: Public Const VK_SHIFT = &H10 IsShifted = (GetKeyState(VK_SHIFT) And &H8000)

Example 2: Checking if the Alt key is down: Code: Public Const VK_ALT = &H12 IsALT = (GetKeyState(VK_ALT) And &H8000)

Conclusion

Understanding hexadecimal values and using bitwise AND can be useful in programming. However, it's essential to note that the context and purpose of using these values should be clear.



Sources:
- [What are &H1, &H8000, etc.? | Tek-Tips] (https://www.tek-tips.com/threads/what-are-h1-h8000-etc.1080522/)
- [Microsoft VBScript runtime error '800a01b6' | Tek-Tips] (https://www.tek-tips.com/threads/microsoft-vbscript-runtime-error-800a01b6.419805/)
- [Error: Only content controls are allowed directly in a ... - Tek-Tips] (https://www.tek-tips.com/threads/error-only-content-controls-are-allowed-directly-in-a-content-page.1504551/)
- [VBA NotifyIcon | Tek-Tips] (https://www.tek-tips.com/threads/vba-notifyicon.1521979/)
- [Why does font-size not inherit ? | Tek-Tips] (https://www.tek-tips.com/threads/why-does-font-size-not-inherit.1050326/)
- [JOIN from HOLD Files possible? | Tek-Tips] (https://www.tek-tips.com/threads/join-from-hold-files-possible.490981/)
- [Launch .VBS file from button on HTML page | Tek-Tips] (https://www.tek-tips.com/threads/launch-vbs-file-from-button-on-html-page.931380/)
- [Vb6 Excel Set Range NumberFormat | Tek-Tips] (https://www.tek-tips.com/threads/vb6-excel-set-range-numberformat.1702432/)
- [resolving template conflict? | Tek-Tips] (https://www.tek-tips.com/threads/resolving-template-conflict.1086638/)
- [JTable: scroll to get the entered row number at the top of screen] (https://www.tek-tips.com/threads/jtable-scroll-to-get-the-entered-row-number-at-the-top-of-screen.1541922/)