Does VB6 support unsigned data types?

To decide on a bet with one of my colleagues, I would like to know if VB6 supports any unsigned data types.

I believe the answer is no, but I can’t find the official documentation to confirm this. An acceptable answer would be a simple link to a Microsoft document. a historical justification of why such types are not supported would be an added bonus.

+6
vb6 unsigned
source share
5 answers

As Chris said, they are not supported, with the exception of the Byte data type, which is only available as unsigned, as can be seen from this list of data types: Brief description of data types

The page mentions VBA, but also mentions Visual Studio 6.0, and the supported data types were the same.

I don’t think you will find official documentation that says why they didn’t add unsigned data types, since this is usually wrong, as this is probably not the case “why we should not support it”, just like "it would be worth the extra effort to add this."

Edited to indicate a Byte data type exception, as indicated by MarkJ.

+9
source share

The only unsigned integer type is Byte.

+2
source share

There is no support for VB6, it was added as described in this in VB.NET.

+1
source share

Not supported.

Some good information regarding the simulation: http://www.vbforums.com/showthread.php?t=578430

0
source share

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

0
source share

All Articles