CUInt or CType (x, UInt) allows you to convert a positive integer .
It throws an exception when x is negative.
To use Int as Uint, you can use some tricks:
dim bb() = System.BitConverter.GetBytes(myInt) dim MyUint = System.BitConverter.ToUInt32(bb, 0)
Also with System.Buffer.BlockCopy for arrays.
If you configured the compiler to disable Check Integer Overflow (default for C #). Then you can use CUInt with negative values without checking - no exception.
x77
source share