12-3-1

Debugging a Program

12-3 Debugging a Program

A programming error that causes a program to behave in a manner not intended by the writer of the program is called a “bug”. Finding and eliminating such errors is called “debugging the program”.

Any of the following conditions can indicate that your program has a bug and requires debugging.

If an error message appears when you try to save the program
If an error message appears when you try to run the program
When a program produces some abnormal or unexpected result
Debugging After an Error Message Appears

When an error occurs, a dialog box appears to explain the cause of the error. Carefully read the text of the error message and then tap its [OK] button. This closes the dialog box and positions the cursor on at the location where the error occurred. Make the necessary corrections in accordance with the explanation provided by the error message.

Tip

If the cause of the error cannot be specified for some reason, tapping [OK] on the error message dialog box displays the Program Loader window, without positioning the cursor at the location of the error.

In the case of a program for which editing is prohibited (a program for which “EXE” is indicated as the variable data type), tapping [OK] on the error message dialog box displays the Program Loader window, without positioning the cursor at the location of the error.

Debugging a Program Following Unexpected Results

If execution of a program produces unexpected or abnormal results, carefully read through the program and correct errors as required.

The following commands can come in handy when debugging a program to locate unexpected results.

To do this:

Execute this command:

 

 

Move the cursor to the beginning of the program
Edit - Search - Jump to Top
Move the cursor to the end of the program
Edit - Search - Jump to Bottom

 

 

20060301