Conversion from Visual Basic 6.0 to Visual Basic. Net (1)

Source: Internet
Author: User

Conversion from Visual Basic 6.0 to Visual Basic. Net (1)

 

 

Microsoft Visual Basic. NET is Microsoft Visual Basic? Later versions, it was re-designed based on the. NET Framework, you can use it to easily create for Microsoft Windows? The next-generation applications of the operating system and web. Visual Basic. Net makes it easy to visually develop web applications, web services, Windows applications, and server-side components. In addition, Visual Basic. net uses the xcopy Deployment Solution for Windows applications, so that you do not have to worry about the dll version. With the release of Visual Basic. net, "DLL nightmare" will become a thing of the past.

 

When designing Visual Basic. net, we focus on the requirements of Visual Basic developers around the world. The Visual Basic language is now a real object-oriented language and supports implementation inheritance. The Form Designer supports visual inheritance and contains new features such as automatic resizing of the form, resource localization, and support for access options. Currently, data tools continue to support XML data and can be used together to bind and disconnect data during design hours. In addition, Visual Basic. NET is directly created based on the. NET Framework. Therefore, all platform features can be used and can work together with other. NET languages.

 

While releasing these features, we made changes to several aspects of the product. This document describes some changes from Visual Basic 6.0 to Visual Basic. NET and explains the reasons for these changes. This article also describes the functions of the Visual Basic. Net Upgrade Wizard. It is a tool provided as part of the product and helps you upgrade existing applications to Visual Basic. net.

 

For more information about upgrading from Visual Basic 6.0 to Visual Basic. net, see the White Paper "Preparing to upgrade a Visual Basic 6.0 Application to Visual Basic. Net ). This White Paper introduces the upgrade process and provides constructive suggestions for the smooth upgrade.

 

Language

Variant

Visual

Basic 6.0 variant is a special "common" data type that can contain all types of data except fixed-length strings. Object variables are used as pointers to objects. The default data type is variant.

 

 

 

Visual Basic. net

 

 

The Common Language Runtime (CLR) uses an object as the common data type. Visual Basic. Net does not continue to use variant as a common data type, but chooses to use CLR naming rules to avoid confusion during cross-language development. Using only one common data type simplifies the type system. The default data type is object.

 

 

 

Upgrade

Wizard

 

 

The following code changes the variant data type to object:

 

Dim X as Variant

After the upgrade, it will be changed:

Dim X as object

 

 

Integer and long

Visual

The basic 6.0 long variable is stored as a 32-bit number with a symbol, and the integer variable is stored as a 16-bit number.

 

 

 

Visual Basic. net

 

 

The long variable is stored as a signed 64-bit number, the integer variable is stored as a 32-bit number, and the short variable is stored as a 16-bit number. In 32-bit systems, 32-bit integer operations are faster than 16-bit and 64-bit integer operations. This means that integer will be the most effective and basic numeric type.

 

Some. NET Framework technologies are based on modern 32-bit and 64-bit technologies, so it is wise to update the data size based on new technologies.

 

 

 

Upgrade

Wizard

 

 

Modify the type of the variable, so the following code:

 

Dim X as integerdim y as long

After the upgrade, it will be changed:

 

Dim X as dim y as integer

 

 

Currency

Visual

Basic 6.0 Visual Basic 6.0 supports the currency data type. You cannot declare a variable of the decimal type (although a variable can have a child type of decimal ).

 

The currency variable is stored as a 64-bit number in integer format. It is represented as a fixed number on a scale of 10,000. The value is 15 digits on the left of the decimal point and 4 digits on the right. This representation can represent numbers in the range of-922,337,203,685,477.5808 to 922,337,203,685,477.5807.

 

The decimal variable is stored as a signed 96-bit integer, And the scale is different from the power of 10. The Scale Factor of the 10 Power indicates the number of digits on the right of the decimal point, ranging from 0 to 28. When the index is 0 (no decimal places), the maximum possible value is +/-79,228,162,514,264,337,593,543,950,335. When the index is 28, the maximum value is +/-7.9228162514264337593543950335, and the minimum non-zero value is +/-0.0000000000000000000000000001.

 

Visual Basic. net

The currency data type is not accurate enough to avoid rounding errors. Therefore, a decimal data type is created.

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.