DataType

Byte


Description

Used to store unsigned 8-bit integer values. The default value is 0. Generally you will use the Integer data type (equivalent to Int32 on 32-bit apps or Int64 on 64-bit apps) or UInteger (equivalent to UInt32 on 32-bit apps or UInt64 on 64-bit apps). This size-specific integer data type is available for use with external OS APIs.

Notes

Byte values can range from 0 to 255 and use 1 byte.

Byte and UInt8 are identical.

All integers on Android are 64-bit integers.


Comparing a Byte to a literal or constant

The type of a numeric literal or constant that is a whole number is the same integer type as the architecture of the platform for which you are building. That means that if you are building for 64 bit, literals and constants will be 64 bit integers.

Therefore to correctly compare them, use CType to cast the literal to a Byte.

In this example the variable Distance is a Byte:

If Distance = CType(0, Byte) Then
  MessageBox("You have arrived.")
End If

Compatibility

All project types on all supported operating systems.

See also

UInteger, UInt8, UInt16, UInt32, and UInt64 data types.