Data Types in Visual Basic 6.0

Data type is a storage format that can contain range of values. A data type in simplest form is to determine what kind of data it can store. Just like every other programming languages, Visual Basic 6 has its own Data Types.

Note: declaring the type of your variable or field is important because every data type has its own memory size, by using a suitable data type for your variable and field can save a memory on your system.

Data types of Visual Basic 6 are the following:

Byte
8 bit, unsigned
Storage size: 1 byte
Range: 0 to 255

Integer
16 bit, signed
Storage size: 2 bytes
Range: -32,768 to 32,767

Long (long integer)
32 bit signed
Storage size: 4 bytes
Range: -2,147,483,648 to 2,147,483,647

Single
32 bit floating point
Storage size: 4 bytes
Range: -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values

Double
64 bit floating point
Storage size: 8 bytes
Range: -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values

Currency
exact representation of decimal numbers of up to four decimal places
Storage size: 8 bytes
Range: -922,337,203,685,477.5808 to 922,337,203,685,477.5807

String
dynamically allocated Unicode strings
Storage size: 10 bytes + string length

Date
Storage size: 8 byte date/time value
Range: January 1, 100 to December 31, 9999

Variant
a holder for any type of value or object.
Storage size: 22 bytes + string length
Range: Same range as for variable-length String

, , , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.