UInt32

From Xojo Documentation

Revision as of 20:16, 30 September 2020 by Gperlman (talk | contribs) (See Also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Data Type


Used to store unsigned 32-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

UInt32 values can range from 0 to 4,294,967,295 and use 4 bytes.

Comparing a UInt32 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 UInt32.

In this example the variable Distance is a UInt32:

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

See Also

UInteger, UInt8, UInt16, and UInt64 data types.