beautypg.com

Debugging a program, Calculating the number of bytes used by a program, Chapter 8 programming – Casio fx-7400G PLUS Programming User Manual

Page 8

background image

132

Chapter 8

Programming

3. Debugging a Program

A problem in a program that keeps the program from running correctly is called a
“bug,” and the process of eliminating such problems is called “debugging.” Either of
the following symptoms indicates that your program contains bugs and that debug-
ging is required.

• Error messages appearing when the program is run

• Results that are not within your expectations

u

uu

u

uTo eliminate bugs that cause error messages

An error message, like the one shown below, appears whenever something illegal
occurs during program execution.

When such a message appears, press

d or e to display the location where the

error was generated, along with the cursor. Check the “Error Message Table” for
steps you should take to correct the situation.

• Note that pressing

d or e will not display the location of the error if the pro-

gram is password protected.

u

uu

u

uTo eliminate bugs that cause bad results

If your program produces results that are not what you normally expect, check the
contents of the program and make necessary changes. See “Editing Program Con-
tents” for details on how to change program contents.

4. Calculating the Number of Bytes Used

by a Program

This unit comes with 20,000 bytes of memory. A byte is a unit of memory that can be
used for storage of data.

There are two types of commands: 1-byte commands and 2-byte commands.

• Examples of 1-byte commands: sin, cos, tan, log, (, ), A, B, C, 1, 2, etc.

• Examples of 2-byte commands: Lbl 1, Goto 2, etc.

While the cursor is located inside of a program, each press of

d or e causes the

cursor to move one byte.

• You can check how much memory has been used and how much remains at any

time by selecting the MEM icon in the Main Menu and entering the MEM Mode.
See “Memory Status (MEM)” for details.

P.200

P.135

P.37

P.133

This manual is related to the following products: