Efficiency is doubled! - Visual Basic.Net New Power

zhaozj2021-02-11  230

Many people have seen me last article - "Complex and Efficient - Visual Basic.Net New Forces", introduced the generic, operator overload, MY namespace, and some in the new version of Visual Basic.Net, " Language improvement, such as unsigned integer, Continue statement, using statement, etc., I believe that the supporters of VB have been happy. This time, I will add new features for Visual Basic Whidbey for VB.

First, continue to perform and automatically repair

Users upgraded from VB6.0 very much miss the very convenient debugging function of VB6.0 explanation. They can modify the code directly when the program is wrong, then continue to run. VB.NET is canceled due to full compilation execution. In Vb.Net Whidbey, this feature is back! The newly added interpreter can break the sky to explain the IL-compiled IL-compiled IL. When there is an abnormality, it will talk about an abnormal balloon (so-called balloon, the prompt window that is often popped up in the tray area of ​​Windows XP). At this time, you can do your code, then gently drag the arrow representative of the running position to the place where you want to start running, and then click Run. Look! The code continues to run. VB finally returned to the previous convenient debugging environment, which is still using VB6 hesitatives, not so fast, VB.NET?

Now VB.NET Whidbey is like Word's syntax prompt function, with "automatic repair" features. As follows:

DIM S as strng

In VB.NET 2003, the IDE will immediately prompt an error, and the IDE will display a "smart tag" under the wrong code while prompting, just like in Word, click Intelligence The tag will pop up the recommended code, such as the correct spelling of String. This feature can help programmers greatly reduce events that modify the code, is the work efficiency doubled?

Second, incomplete type

Once, a type, such as modules, class, etc. must be completed in one file, that is, a class cannot be implemented in two files, respectively. This brings trouble to some special requirements, such as the form contains the interface partial and functional part, the interface part is best designed by experience in experience, and the functional part is written by programmers. At this time, the two can't work at the same time. Otherwise the version will be generated. Now VB.Net Whidbey supports incomplete type, you can write a type in two files, respectively:

Public Expands Class Test

'This is the first part of Test

Public Sub Function1 ()

'Some Code

End Sub

END CLASS

'

Public Expands Class Test

'This is the second part of Test

'Some Other Code

END CLASS

Now the same type can also be placed in different files, and it is implemented by different files. If you make good use of this function, is the efficiency of twice?

Third, XML comment documentation

If you write a comment, you can become a document, then the programmer will not improve the enthusiasm of writing documents? XML comment documentation is not only like this. By embedded XML comment documentation, the programmer can convert the input comments into documents, but also create a beautiful HTML document report using IDE. At the same time, writing XML document comments can be provided directly to input coding. Such as

'@

'@ This is a description of this method

'@

Public Sub TestMethod ()

When using TestMethod next time, not only automatically complete, but also display comment information "This is the description of this method", so you will never let the code mess. The XML document is the function of C # originally with it. Its convenient use allows programmer to love unnecessary, now in VB programmers, finally introduced VB.NET Whidbey. With XML comment document, write documentation and write program two for one, does the work efficiency are twice more? (The syntax in this example has not finally determined)

Fourth, automatically complete user interface and intelligent tag

The current IDE auto-completion feature is also limited to text code, can the user interface can not be completed automatically? VB.Net Whidbey gives you a new feeling. A data source from a data connection can be created directly in the newly added data source window. Simply click the field you want to use, then press OK to complete the establishment of the data source. Now, as long as the data source is dragged to the form, a set of interface elements, including DataGrid, forward, and back button, UPDATE button, etc., the previous only VB6 data environment is so convenient. However, VB.NET Whidbey is not allowed, as long as you click on the smart tag that appears below the window, you can change the form of the data interface, such as using a traditional data form or a DataGrid style can be set. If you use a data form, enter each field control flexible control through your smart tag, such as a field is read-only, then you can change the control from the text box to the tab, and this change only needs to be gently Mouse. All of these features do not need to manually enter a code, automatically complete the user interface and smart tags to create great convenience, which improves the improvement of work efficiency more than twice.

V. Code pieces

Everyone will find that there are many usual code in the program, such as the TRY structure, the operation in the file operation, the operation of the read, close or registry, although it is used, but must be input from the end It is really trouble. Now VB.NET Whidbey provides the function of the code snippet. Some commonly used program structures have been defined as a code snippet, as soon as you right click, you can easily join the code snippet. The added code snippet There are many places that require user changes, such as open files, which require users to enter files and read and write variables, etc., these places are marked with obvious color to allow users to "fill in the blank". With the code snippet, you will find that many commonly used code do not need to be written, as long as you can easily press the code snippet, then fill in the blank, you can generate standard code. Is this feature that makes your code efficiency double?

VB.NET's upgrade greatly enhances the RAD programming function of VB this language, Microsoft claims to make your encoding more than 50%, is this true? After reading the introduction above, do you doubt? Looking forward to this version of VB, making the work efficiency twice!

转载请注明原文地址:https://www.9cbs.com/read-5125.html

New Post(0)