In order to settle a bet with one of my colleagues, I would like to find out if VB6 natively supports any unsigned data types.
I believe the answer to be "no", but I can't seem to find any official documentation confirming that. A simple link to a Microsoft document would be an acceptable answer; an historical justification as to why such types are not supported would be an added bonus.
An unsigned data type simply means that the data type will only hold positive values; negatives aren't allowed to be stored in the data type. Unsigned data types include int, char, short, and long.
The two fundamental data types in Visual Basic are value types and reference types. Primitive types (except strings), enumerations, and structures are value types. Classes, strings, standard modules, interfaces, arrays, and delegates are reference types.
The data type of a programming element refers to what kind of data it can hold and how it stores that data. Data types apply to all values that can be stored in computer memory or participate in the evaluation of an expression.
As Kris said, they're not supported, except for the Byte
datatype, which is only available as unsigned, as can be seen in this list of datatypes: Data Type Summary
The page mentions VBA, but it also mentions Visual Studio 6.0, and the supported data types were the same.
I don't think you'll find official documentation saying why they didn't add unsigned data types since that's usually the wrong way around in that it probably wasn't a case of "why shouldn't we support this" as much as "would it be worth the extra effort to add this".
Edited to mention the exception of the Byte
datatype as pointed out by MarkJ.
The only unsigned integer type is Byte.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With