Data Type in VB

Source: Internet
Author: User

 

 

1. boolean type, which only occupies two bytes: true and false (true or false.

2. The Byte byte occupies one byte, which ranges from 0 to 255.

3. An integer occupies two bytes, usually expressed as %. For example, a %. It occupies two bytes (4 bytes in C) and the value range is 0----32768/32767.

4. The long integer occupies 4 bytes. Its abbreviated symbol is &, and its range is-2147483648 to 2147483647.

For integer and long integer types, we usually choose a long integer type. Although the long integer type is relatively large, it is faster than the integer type because the CPU is generally 32-bit, long integer data can be stored in registers or CPUs at a time, and the compatibility of long integer data is better.

5. Single single precision Floating Point 4 bytes. The range is large, but the accuracy is very small. In scientific computing, you don't need to change the accuracy. Its symbol is!

6. Double double.

7. String string a. variable-length string, used to read files, text searches, and so on.

B. Fixed Length characters

8. The date format is #............ #, For example, may be expressed as # November 11 #

9. Currency @

10. User Defined

11. variant variable type in VB, variables can not be declared, different from the above type, after assigning a value, you can assign another type of value to him, for example, the original is a string, later, he was assigned a date. Variant format:

Type Variable (such as integer)

Corresponding data and address

The disadvantage of variant is that the memory usage is large and the speed is slow. The convenience is flexible usage.

The data types in VB are not isolated. They can be converted to each other using conversion functions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.