What are different types of errors? Explain each.
- Syntax errors
- Execution errors
- Logic Errors
- Syntax errors: The syntax errors are those that appear as you type the code. Visual Basic checks your code when you type it in the Code Editor window and warns you if you make a mistake, such as mistyping a word or using a language element incorrectly. Syntactic errors are the most frequent errors. They can be easily corrected in the coding environment as soon as they occur.
- Execution errors: The errors at run-time are those that appear only after compiling and running the code. Errors of this type can be given, for example, in seemingly correct code fragments, for they do not present syntactic errors, but they do not execute correctly. For example, you could correctly type a line of code that opens a file. But, if the file is corrupted, the application will not be able to execute the Open function and will stop its execution. Most of the errors of this type can be corrected by modifying the code that presents errors, then compile it and re-execute it.
- Logic errors: The logical errors are those that appear when the application is running. They are often unwanted or unexpected in response to user actions. For example, a badly written key or other external influence could cause the application to stop working even if the parameters are correct, or that it simply does not work. Usually, logical errors are the most difficult to correct, since it is not always clear where they originate.
Comments