Joke Collection Website - Blessing messages - How to display hexadecimal numbers in VB?

How to display hexadecimal numbers in VB?

1) For an integer of Long data type in VB, you can use the Hex function to obtain its hexadecimal string.

Hex function returns a String representing a hexadecimal value.

The following is the result of VB6.0 immediate window operation. debug.Print?hex(2147483647)

7FFFFFFF

debug.Print?hex(-2147483648)

80000000

2) VB For converting other data types into hexadecimal, you need to use the API function named CopyMemory to obtain the byte values ??of the data and convert them into hexadecimal characters for splicing and display.