UInt8 Data Type

Holds unsigned 8-bit (1-byte) integer values in the range 0–255.


Default value
When you declare a variable of type UInt8 and do not initialize it, its default value is zero (0).

If you use the negation operator (-) on an unsigned type, ViviFire gives a warning that this operation is usually an error.

If you subtract a larger number from a smaller number, the result is calculated as follows:

number Mod UInt8.Max + 1
Type changes
UInt8 widens to Int16, UInt16, Int, UInt, Int32, UInt32, Int64, UInt64, Int128, UInt128, Real32, Real64, Real, or Real128 without risk of overflow.
Type characters
UInt8 has no type characters.

Shared methods and properties

uInt8.Default As UInt8
Returns the default value, 0.
UInt8.Max As UInt8
Returns the maximum positive value.
UInt8.Min As UInt8
Returns the minimum value. This is always zero (0)
UInt8.Parse(str As String, Optional #fmt As Format) As UInt8
Tries to parse a string that shows as an integer.
If #fmt is not given or is #Null, then it tries to parse str as a decimal (base-10) integer. Or you can be explicit with Format.Base10.
UInt8.Size As Int
Returns the number of available bytes. This is always one (1).


Example 1

Dim foo As UInt8

Example 2

Dim low As UInt8 = 0, high As UInt8 = 100
Dim result As UInt8 = low - high
After execution
low0 (&H00)
high100 (&H64)
result156 (&H9C)

See also