There is the option of passing hexadecimal values to a long type, which will be stored as unsigned if the signed bit is not part of the value. eg,
&HFFFF = -1 but &HFFFF& = 65535
note that these 16-bit sums are passed in a long type, which is 32 bits. therefore, the sign bit is not touched. but if you need 32 bits, one suggestion was to use the Double type, someone had mentioned this before.
Regarding the need for unsigned types in general, the Unsigned Long will be a 32-bit binary, compared to a byte that is only 8 bits. Try to write 24-bit registers through a serial port with byte types. :) My trick is that in VBA the sign bit sits like a splinter in the way of the bit logic.
anyway, hopefully this helps someone.
amuses
Norwood, Massachusetts
oneMate
source share