What is &H1, &H8000, etc.?

By Ava DeLorean | Created on 2025-10-03 10:37:10

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

0:00 / 0:00

Introduction

In the world of programming, hexadecimal numbers are a common sight. But have you ever wondered what those strange-looking numbers like &H1 and &H8000 mean? In this article, we'll delve into the world of hexadecimal numbers and explore their meaning.

What are Hexadecimal Numbers?

Hexadecimal numbers are a way of representing numbers using a base-16 number system. This means that each digit in a hexadecimal number can have one of 16 values, ranging from 0 to 9 and then A to F. The &H symbol is used to indicate that the following number is in hexadecimal format.

Examples

Let's take the example of &H1. In decimal (base-10) format, this would be equal to 1. Similarly, &H8000 would be equivalent to 32768 in decimal format.

How Do We Use Hexadecimal Numbers?

Hexadecimal numbers are commonly used in programming to represent virtual key codes and other constants. For instance, the VK_SHIFT constant is represented as &H10, while the VK_CONTROL constant is represented as &H11.

Conclusion

In conclusion, hexadecimal numbers are a powerful tool for programmers. By understanding what these strange-looking numbers mean, we can unlock new possibilities in our programming endeavors. Whether you're working with virtual key codes or other constants, hexadecimal numbers will be your new best friend.

Code Snippets

Example 1: Checking if the Shift Key is Pressed

To check if the shift key is pressed, we can use the following code snippet:

Public Const VK_SHIFT = &H10 Dim IsShifted As Boolean IsShifted = (GetKeyState(VK_SHIFT) And &H8000)

Example 2: Checking if the Alt Key is Pressed

To check if the alt key is pressed, we can use the following code snippet:

Public Const VK_ALT = &H12 Dim IsALT As Boolean IsALT = (GetKeyState(VK_ALT) And &H8000)

Final Thoughts

In conclusion, hexadecimal numbers are a powerful tool for programmers. By understanding what these strange-looking numbers mean, we can unlock new possibilities in our programming endeavors. Whether you're working with virtual key codes or other constants, hexadecimal numbers will be your new best friend.

Additional Resources

If you want to learn more about hexadecimal numbers and their applications in programming, I recommend checking out the following resources:

Conclusion

In conclusion, hexadecimal numbers are a powerful tool for programmers. By understanding what these strange-looking numbers mean, we can unlock new possibilities in our programming endeavors. Whether you're working with virtual key codes or other constants, hexadecimal numbers will be your new best friend.



Sources:
- [What are &H1, &H8000, etc.? | Tek-Tips] (https://www.tek-tips.com/threads/what-are-h1-h8000-etc.1080522/)
- [H1 in publisher | Tek-Tips] (https://www.tek-tips.com/threads/h1-in-publisher.1601129/)
- [Moving Aplications to a new screen in C# | Tek-Tips] (https://www.tek-tips.com/threads/moving-aplications-to-a-new-screen-in-c.1416749/)
- [Coverage Paths | Tek-Tips] (https://www.tek-tips.com/threads/coverage-paths.1632312/)
- [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/)
- [Why does'nt text-align:justify work? Help | Tek-Tips] (https://www.tek-tips.com/threads/why-doesnt-text-align-justify-work-help.1690560/)
- [Send 8-bit data over serial port; values over 3F are being set to 3F] (https://www.tek-tips.com/threads/send-8-bit-data-over-serial-port-values-over-3f-are-being-set-to-3f.1672795/)
- [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/)
- [Forwarding one internal extension to External number | Tek-Tips] (https://www.tek-tips.com/threads/forwarding-one-internal-extension-to-external-number.1574548/)