For a real software projects, most programmers are not used in the encoding time, but on debugging on a piece of code just finished writing, they usually are seemingly perfect, in fact, can not run, which contains many errors even the best programmers can not predict, so we need to debug to find errors in our code, and its eleven repair, so that we can achieve our final code is expected to function.
VBA code The same is true, it is fortunate that Microsoft has provided us with complete debugging environment, that is, we often use VBAIDE (VBA integrated development environment), there are many Access novice learning to write VBA code at the beginning of time, often obsessed with learning the syntax , functions, etc. office 2010 ultimate key, but neglected to learn VBAIDE to use, this result is that you often face a seemingly perfect but actually can not run the program helpless.
This article will introduce the complete VBA code to debug, although this not VBAIDE complete tutorial and documentation, but through study and practice for this article, you can learn to find their own errors in the code.
selected article for our first debugging exercises. Examples accessories are:
[attach] 17823 [/ attach]
for a debugging system, we will have access to the following concepts:
1, compile compilation is the most basic debugging features, so we were able to compile is to understand the programming language code into machine able to read the code, compile the function of different systems are different, VBA is a build system to generate intermediate code mmPCode, as he is, we do not need to get to the bottom, but we need to understand that all grammar is correct only if all the code can be compiled, so this helps us check the syntax of our code is correct , including whether it was proper variable declaration, etc.. usually have obvious syntax error, VBAIDE with a red font to display problematic lines of code, but debugging is not limited to these lines of code, and the whole process of inspection, the red line in the font can be determined only identify the error, debugging code is to identify the whole range of errors, such as variable type declaration does not match, and so on. In our example, we open the corporate data form code, you can see the following chart positions, there is a line of code red, indicating that this line of code there is a syntax problem. jYHhxohu.jpg problem is the lack of proper spaces in the code, in & around add a space after the issue is resolved and now the code has no Code Red cheap office 2010 key, and then let us try compile, select . jpg error message is displayed: the type of variable declaration does not match, and automatically select the error code a legal syntax, it does not recognize this single error, but all the code is compiled, the problem is exposed, so we add the space windows 7 ultimate key, and remove the last two unnecessary compilation, we have encountered an error in the figure below, a closer look, the code at the Exit statement after the label has two underscores, but only one call site buy windows 7 key, hQ3COjz5.jpg obvious typographical errors. revised once again compiled by. compiled, and can not find any errors in our code, because the computer is not smart enough to understand the human in the end we want to do, but the compiler is still the most important step debugging, because he at least allows you to correct grammar, so your program can be executed, only to be executed in order to continue our subsequent debugging. Related Articles:
Project2003 project management software tutorial s
Small Collection computer skills
Recommended to use a powerful wizard-driven 2008 B
VML tutorial