Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does VB6 support unsigned data types?

Tags:

unsigned

vb6

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.

like image 487
Fueled Avatar asked Feb 02 '11 13:02

Fueled


People also ask

What data types does an unsigned data type support?

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.

What are data types in Visual Basic?

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.

What is datatype in VB net?

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.


2 Answers

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.

like image 91
Hans Olsson Avatar answered Sep 21 '22 22:09

Hans Olsson


The only unsigned integer type is Byte.

like image 26
Bob77 Avatar answered Sep 19 '22 22:09

Bob77