Chris's Event Programming with Visual Basic course.
Contents
| Introduction | Tool Bars & Control Arrays |
There are three types of errors you may encounter as you run your
application:
Compile errors occur as a result of code that is incorrectly
constructed. You may have an incorrectly matched control structure,
such as a Next statement without a corresponding For statement,
or programming mistakes that violate the rules of Basic, such
as a misspelled word, a missing separator, or a type mismatch.
Compile errors include syntax errors, which are errors in the
grammar or punctuation recognised by Visual Basic. Examples of
syntax errors include passing an incorrect number of arguments
to an intrinsic function or forgetting to match parentheses.
Run-time errors occur after the application starts to execute.
Examples of run-time errors include attempting an illegal operation,
such as writing to a file that doesn't exist, or dividing by zero.
Logical errors where the program doesn't perform as intended,
and produces incorrect results.
Debugging is a process by which you find and resolve errors in
your code. To debug code in Visual Basic, consider the ideas suggested
below. These techniques can also be applied in different sequences.
2. Run the application to find trouble spots:
3. Use debugging tools and techniques to isolate bugs and to monitor
code flow:
4. Try out bug fixes and then make edits:
Visual Basic and all other Microsoft products mentioned
in this series are trademarks of the Microsoft Corporation.