UInt Data Type

Holds unsigned integer values sure to be a minimum of 32 bits (4 bytes) and gives good performance. On 32-bit platforms, values are in the range 0–4,294,967,295


UInt is short for “unsigned integer”.

Default value
When you declare a variable of type UInt 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, you find the result as follows:

number Mod UInt.Max + 1
Automatic conversions
UInt widens to UInt64, UInt128, Real32, Real64, Real, or Real128 without risk of overflow.
Type characters
UInt has no type characters.

Shared methods and properties

UInt.Default As UInt
Returns the default value, 0.
UInt.Max As UInt
Returns the maximum value.
UInt.Min As UInt
Returns the minimum value. This is always zero (0).
UInt.Parse(str As String, Optional #format As Format) As UInt
Tries to parse a string that shows as an integer.
If #format is not given or is #Null, it tries to parse str as a decimal (base-10) integer. Or you can make it clear with Format.Base10.
UInt.Size As Int
Returns the number of available bytes. Typical values are 4 or 8.


Example 1

Dim foo As UInt

Example 2

Dim low As UInt = 0, high As UInt = 100
Dim result As UInt = low - high
After execution
Variable32-Bit Value
low0 (%X00000000)
high100 (%X00000064)
result4294967196 (%XFFFFFF9C)

See also