UInt Data Type

Holds unsigned integer values guarenteed to be at least 32 bits (4 bytes) and provides the best performance. On 32-bit platforms, values are in the range 0–4,294,967,295

Instructions

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).
Negation

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 UInt.Max + 1
Type changes
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 #fmt As Format) As UInt
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.
UInt.Size As Int
Returns the number of available bytes. Typical values are 4 or 8.

Examples

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 (&H00000000)
high100 (&H00000064)
result4294967196 (&HFFFFFF9C)

See also