beautypg.com

Error window/fixing syntax errors, Debugging – Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 37

background image

36

CHAPTER 3 • GETTING STARTED

Figure 3.6 – Making Changes to the Code

Error Window/Fixing Syntax Errors

Follow the steps below to create and fix a syntax error (see Figure 3.7):
1 Create a syntax error by deleting the letter “p” from the function name “printf” in

ExampleCode3.1.c.

2 After deleting the letter “p,“ attempt to compile the program. When the Dynamic C

IDE detects an error, the Compiler Messages window will display a list of warnings

and errors.

3 Double-click on the error message in the Compiler Messages window and the source

code will be displayed in the editor window. The line of code that contains the error

will be highlighted.

4 Fix the syntax error by reinserting the letter “p” into the “printf” function name.

5 After restoring the letter “p,“ compile and execute the program again to make sure the

error is resolved.

Figure 3.7 – Fixing Syntax Errors

Debugging

Dynamic C contains several techniques for debugging. The most useful techniques are de-

scribed below.