April 2002
Intermediate to advanced
1024 pages
23h 26m
English
Exceptions are relatively new to VB; therefore, many VB programmers will take a little while to get used to the syntax and the idea behind exceptions. VB's On Error GoTo XXX resembles current exception handling.
Listings 15.15 and 15.16 illustrate the basics of VB exception handling. This code sample follows the form of the VC++ sample shown earlier in that an ExceptionGenerator throws or causes various exceptions based on an integer selector that is passed as an argument. This sample illustrates a custom exception, a divide-by-zero exception, a stack overflow exception, and a FileNotFoundException. The full source for this sample can be found in the VBExceptions\BasicExceptions directory. Listing 15.15 shows ...
Read now
Unlock full access