In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what are the basic data types in vb. It is very detailed and has a certain reference value. Friends who are interested must finish reading it!
There are 9 basic data types in vb, which are character data type, numeric data type (integer, long integer, single-precision floating-point, double-precision floating-point), currency type, byte type, Boolean type, date type, general type, unsigned type and object type.
The basic data types provided by VB 6.0are: character data, numerical data, currency type, byte type, Boolean type, date type, general type, unsigned type, object type and so on.
1. Character data
Character data (String) is used to define a sequence of characters. A character is stored in memory with a byte.
2. Numerical data
Numerical data include: integer type, long integer type, floating point type (single precision and double precision).
(1) Integer number
Integer (Integer): a number with no decimal point, ranging from-32 768 to 32 767, using 2 bytes (16 bits) to store an integer in memory. A number between-32 678 and 32 767 plus a "%" symbol at the end also indicates a kind of integer data, such as 1 345% last 67%. '
(2) number of long integers
Long integer (Long): a number beyond the range of-32 768 and 32 767, but without a decimal point between-2 147 483 648 2 147 483 647, a long integer occupies 4 bytes (32 bits) in memory. The number between-2 1 47 483 648 and 2 1 47 483 647 has a "&" symbol at the end, which is also represented as a long integer.
(3) floating point
Single precision number (Single): a real number with a decimal point, with a valid value of 7 digits. Store a single-precision number in memory with 4 bytes (32 bits). It is usually expressed in the form of an index (scientific notation), and the index part is represented by "E" or "e".
Double precision data (Double): also a real number with a decimal point, with a valid value of 15 digits. Store a double-precision number in memory with 8 bytes (64 bits). Double precision numbers are usually expressed in exponential form (scientific notation), and the exponential part is represented by "D" or "d".
3. Currency type
Currency type (Currency): a fixed-point data type set to calculate currency. It requires high precision and is specified to be accurate to 4 decimal places. Occupies 8 bytes (64 bits) in memory. Values range from-922 337 203 685 477.5805 to 922 337 203 685 477.5807.
4. Byte (Byte) type
Byte type: a numeric type that is stored as a 1-byte unsigned binary number with a value range of 0,255.
5. Boolean type
Boolean type (Boolean): Boolean data is a logical value, also known as a logical type, stored in two bytes, which takes only two values, namely 'Frue (true) or False (false).
6. Date Typ
Date type (Date): used to represent a date. A date-type data is stored in memory with 8 bytes.
7. Common type
A Variant, also known as a variant type, is a universal, mutable data type that can represent any of the above data types. Suppose that an is defined as a universal variable.
Dim an As Variant
You can store any type of data in variable a, such as:
ARV Murray basic'- stores a string
Av10-stores an integer
Axiom 20.5-stores a real number
A date-type data is stored in a date-type data, which is stored in the color 08 / 10 / 15 / 2003'.
Depending on the type of value assigned to a, the type of variable an is constantly changing, which is why it is called a variant type. When a variable does not define a type, VB automatically defines the variable as a Variant type. Different types of data are stored according to their actual types in the Variant variable (for example, an integer is assigned to an and stored as integers in the memory area). The user does not have to do any conversion work, and VB completes it automatically.
8. Unsigned type
Unsigned type (Decimal): the variable stores a 96-bit (12-byte) unsigned integer and divides it by a power of 1 O, called the ratio factor. This ratio factor determines the number of digits to the right of the decimal point, which ranges from Olympian 28.
Description: currently, Decimal data types can only be used in variant types (Variant), that is, you cannot declare a variable as a Decimal. Type.
9. Object type
Object type (Object): used to represent graphics, OLE objects, or other objects, stored in 4 bytes.
The above is all the content of the article "what are the basic data types in vb". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.