A good programmer should be more alert to the parts of the program that could trigger errors and should write errors handling code to help the user in managing the errors. Writing errors handling code is a good practice for Visual Basic 2010 programmers, so do not try to finish a program fast by omitting the errors handling code. On the other hand, there should not be too many errors handling code in the program as it creates problems for the programmer to maintain and troubleshoot the program later. VB2010 has improved a lot in its built-in errors handling capabilities compared to older version versions of VB.
For example, when the user attempts to divide a number by zero, Vb2010 will not return an error message but gives the 'infinity' as the answer (although this is mathematically incorrect because it should be undefined)
Visual Basic 2010 still supports the VB6 errors handling syntax, that is the On Error GoTo program_label structure. Although it has a more advanced error handling method, we shall deal with that later.We shall now learn how to write errors handling code in VB2010. The syntax for errors handling is
On Error GoTo program_label
To learn the details, we suggest you grab a copy of Visual Basic 2010 Made Easy.
AUTHOR: DR. LIEW VOON KIONG
Visual Basic 2010 Made Easy is an eBook authored by the webmaster of our Visual Basic 2010 Tutorial, Dr.Liew. With more than 200 pages of contents, it complements our free online tutorial by providing a complete tutorial for beginners.
By reading this book, you can:
*Please wait for 10 seconds for PayPal to redirect you to E-book Download Page after ordering and making payment.
Mode of Delivery: Download
This site and the products and services offered on this site are not associated, affiliated, endorsed, or sponsored by Microsoft, nor have they been reviewed tested or certified by Microsoft.
If you require assistant and technical support, please contact:Admin