Debugging A Program; Debugging After An Error Message Appears; Debugging A Program Following Unexpected Results; Editing A Program - Casio fx-CP400 User Manual

Table of Contents

Advertisement

12-2 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
• If 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, opens the Program Editor window, and
positions the cursor at the location where the error occurred. Make the necessary corrections in accordance
with the explanation provided by the error message.
Tip:
EXE type files (page 194) cannot be edited. Tapping the [OK] button on the error dialog box will simply close the dialog
box without displaying the Program Editor window. Open the backup PRGM file that was generated when you
created the EXE file by converting it from a PRGM file, and use it for debugging.

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.

Editing a Program

u To edit a program
1. On the Program Loader window, tap ~, or tap [Edit] and then [Open File].
2. On the dialog box that appears, select the program you want to edit, as described below.
• Tap the [Type] down arrow button and then select "Program(Normal)".
• Tap the [Folder] down arrow button and then select the folder that contains the program you want to edit.
• Tap the [Name] down arrow button, and then select the name of the program you want to edit.
3. Tap [OK].
4. Edit expressions and commands as required.
5. To overwrite the currently saved program with the edited version tap {, or tap [Edit], [Save File] and then
[Save].
• To save the edited version of the program as a different program, use [Edit] - [Save File] - [Save As].
u To rename or delete a program
Programs are saved as variables, so you can rename and delete them using Variable Manager. For details,
see "Using Variable Manager" (page 27).
Chapter 12: Program Application
195

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Classpad ii

Table of Contents