Debugginghelp - 1 HELP FOR DEBUGGING VB CODES Debugging is...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 HELP FOR DEBUGGING VB CODES Debugging is an essential part of programming. Even for an experienced programmer most codes will not work in the first attempt due to typo, mathematical errors and logical flaws. These errors or bugs have to be corrected before your program would yield desired results. The goal of this tutorial is to introduce you to tools that can help fix your buggy code. There are 3 kinds of errors (bugs) in the code: Compilation errors or syntax errors: When you run your VB code, the visual basic compiles your code into binary language which your computer can understand. If the compiler comes across some syntax that it cannot understand, it issues a compiler error. Most of the compiler errors are typos. For example, typing “Iteger” instead of “Integer,” not ending an If statement or a For loop. They are easy to fix and are caught by the compilers and pointed out to you. Adding OPTION EXPLICIT will help flag most typographic errors in the variable names. Run time errors: These are errors which occur when the program encounters a mathematically incorrect situation under certain conditions. For example, in an expression x = a/b; the effort will occur only when b becomes zero. Logic errors: They are due to a wrong logic in the code. These are difficult to debug since it needs expert knowledge. For example, if the programmer used a wrong formula for a system (say computing moment of inertia) then only an expert can identify the problem! The most straightforward method of debugging is to carefully go through the code line-
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/14/2011 for the course CE 3010 taught by Professor Clement during the Fall '09 term at Auburn University.

Page1 / 5

Debugginghelp - 1 HELP FOR DEBUGGING VB CODES Debugging is...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online