Casio fx-7400G PLUS User manual

Programming
1. Before Programming
2. Programming Examples
3. Debugging a Program
4. Calculating the Number of Bytes Used by a Program
5. Secret Function
6. Searching for a File
7. Editing Program Contents
8. Deleting a Program
9. Useful Program Commands
10. Command Reference
11. Text Display
12. Using Calculator Functions in Programs
Chapter
8

126
Chapter 8 Programming
1. Before Programming
The programming function helps to make complex, often-repeated calculations quick
and easy. Commands and calculations are executed sequentially, just like the manual
calculation multistatements. Multiple programs can be stored under file names for
easy recall and editing.
Select the PRGM icon in the Main Menu and enter the PRGM Mode. When you do,
a program list appears on the display.
Selected memory area
(use
f
and
c
to move)
1(EXE) ........ Execute program
2(EDIT) ....... Program edit
3(NEW) ...... New program
[
1(DEL) ........ Specific program delete
2(DEL•A) .... Delete all
3(SRC) ....... File name search
Press [to return to the previous menu.
•If there are not programs stored in memory when you enter the PRGM Mode, the
message “No Programs” appears on the display and only the NEW item (3) is
shown in the function menu.
File Name
Program
File Name
Program
File Name
Program
1234[
1234[
P. 138
P. 138
P. 135

127
Programming Chapter 8
A
1234
2. Programming Examples
Example 1To calculate the surface area and volume of three regular
octahedrons of the dimensions shown in the table below
Store the calculation formula under the file name OCTA.
Length of One Side (A) Surface Area (S) Volume (V)
7 cm cm2cm3
10 cm cm2cm3
15 cm cm2cm3
The following are the formulas used for calculating surface area S and volume V of a
regular octahedron for which the length of one side is known.
2
S = 2 3 A2,V= –––– A3
3
When inputting a new formula, you first register the file name and then input the
actual program.
uu
uu
uTo register a file name
Example To register the file name OCTA
•Note that a file name can be up to eight characters long.
1. While the program list is on the display, press 3(NEW).
3(NEW)
3(Q).......... Password registration
4(SYBL) ...... Symbol menu
2. Input the name of the file.
OCTA
•The cursor changes form to indicate alpha character input.
•The following are the characters you can use in a file name:
A through Z, spaces, [, ], {, }, ’, ”, ~, 0 through 9, ., +, –, ×, ÷

128
Chapter 8 Programming
•Pressing 4(SYBL) displays a menu of symbols that can be input.
4(SYBL)
•You can delete a character while inputting a file name by moving the cursor to the
character you want to delete and pressing D.
3. Press wto register the file name and change to the program input screen.
w
•Registering a file name uses 17 bytes of memory.
•The file name input screen remains on the display if you press wwithout input-
ting a file name.
•To exit the file name input screen and return to the program list without register-
ing a file name, press Q.
uu
uu
uTo input a program
Use the program input screen to input the contents of a program.
1(TOP) ........ Top of program
2(BTM) ....... Bottom of program
3(MENU) .... Mode menu
•Pressing [displays a menu of symbols that can be input into a program.
[
[
Press [to return to the previous menu.
1234
File name
P. 136
P. 136
1234[
1234[
1234[

129
Programming Chapter 8
uu
uu
uTo change modes in a program
•Pressing 3(MENU) while the program input screen is on the display causes a
mode change menu to appear. You can use this menu to input mode changes into
your programs. For details on each of these modes, see “Using the Main Menu”, as
well as the sections of this manual that describe what you can do in each mode.
3(MENU)
•Pressing !Zdisplays a menu of commands that can be used to change set
up screen settings inside a program. For details on each of these commands, see
“To change a mode set up”.
!Z
[
[
[
[
[
Actual program contents are identical to manual calculations. The following shows
how the calculation of the surface area and volume of a regular octahedron would be
calculated using a manual calculation.
Surface Area S ... c*!9d* <value of A> xw
Volume V ............ !9c/d* <value of A> Mdw
You could also perform this calculation by assigning the value for the length of one
side to variable A.
Length of One Side A
............. <value of A> aaAw
P. 2
P. 6
1234
1234[
1234[
1234[
1234[
1234[
1234[

130
Chapter 8 Programming
Surface Area S ... c*!9d*aAxw
Volume V ............ !9c/d*aAMdw
If you simply input the manual calculations shown above however, the calculator
would execute them from beginning to end, without stopping. The following com-
mands make it possible to interrupt a calculation for input of values and display of
intermediate results.
?: This command pauses program execution and displays a question mark as a
prompt for input of a value to assign to a variable. The syntax for this command
is: ? →<variable name>.
^^
^^
^:This command pauses program execution and displays the last calculation re-
sult obtained or text. It is similar to pressing win a manual calculation.
•For full details on using these and other commands, see “Useful Program Com-
mands”.
The following shows examples of how to actually use the ? and ^commands.
!W[1(?)aaA[3(:)
c*!9d*aAx
[[2(^)
!9c/d*aAMd
QQ
uu
uu
uTo run a program
1. While the program list is on the display, use fand cto highlight the name of
the program you want to run.
2. Press 1(EXE) or wto run the program.
Let’s try running the program we input above.
Length of One Side (A) Surface Area (S) Volume (V)
7 cm 169.7409791 cm
2
161.6917506 cm
3
10 cm 346.4101615 cm
2
471.4045208 cm
3
15 cm 779.4228634 cm
2
1590.990258 cm
3
P. 139
1234

131
Programming Chapter 8
1(EXE) or w
hw
(Value of A)
Intermediate result produced by
^
w
w
baw
w
•Pressing wwhile the program’s final result is on the display re-executes the
program.
•You can also run a program while in the RUN Mode by inputting:
Prog ”<file name>” w.
•An error (Go ERROR) occurs if the program specified by Prog ”<file name>”
cannot be found.
1234
P. 149

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
uu
uu
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 dor eto 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 dor ewill not display the location of the error if the pro-
gram is password protected.
uu
uu
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 dor ecauses 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. 3 7
P. 133

133
Programming Chapter 8
5. Secret Function
When inputting a program, you can protect it with a password that limits access to
the program contents to those who know the password. Password protected pro-
grams can be executed by anyone without inputting the password.
uu
uu
uTo register a password
Example To create a program file under the name AREA and protect it with
the password CASIO
1. While the program list is on the display, press 3(NEW) and input the file name
of the new program file.
3(NEW)
AREA
2. Press 3(Q) and then input the password.
3(Q)
CASIO
•The password input procedure is identical to that used for file name input.
3. Press wto register the file name and password. Now you can input the contents
of the program file.
•Registration of a password uses 16 bytes of memory.
•Pressing wwithout inputting a password registers the file name only, without a
password.
4. After inputting the program, press Qto exit the program file and return to the
program list. Files that are password protected are indicated by an asterisk to the
right of the file name.
Q
P. 127
123356

134
Chapter 8 Programming
uu
uu
uTo recall a program
ExampleTo recall the file named AREA which is protected by the
password CASIO
1. In the program list, use fand cto move the highlighting to the name of the
program you want to recall.
2. Press 2(EDIT).
2(EDIT)
3. Input the password and press wto recall the program.
•The message “Mismatch” appears if you input the wrong password.
6. Searching for a File
You can search for a specific file name using any of the three following methods.
•Scroll Search — scroll through the file names in the program list.
•File Name Search — input the name of the file.
•Initial Character Search — input the first few letters of the name of the file.
uu
uu
uTo find a file using scroll search
Example To use scroll search to recall the program named OCTA
1. While the program list is on the display, use fand cto scroll through the list
of program names until you find the one you want.
2. When the highlighting is located at the name of the file you want, press 2(EDIT)
to recall it.
2(EDIT)
1234

135
Programming Chapter 8
uu
uu
uTo find a file using file name search
Example To use file name search to recall the program named OCTA
1. While the program list is on the display, press 3(NEW) and input the name of
the file you want to find.
3(NEW)
OCTA
2. Press wto recall the program.
•If there is no program whose file name matches the one you input, a new file is
created using the input name.
uu
uu
uTo find a file using initial character search
Example To use initial character search to recall the program named OCTA
1. While the program list is on the display, press [3(SRC) and input the initial
characters of the file you want to find.
[3(SRC)
OCT
2. Press wto search.
w
•All files whose file names start with the characters you input are recalled.
•If there is no program whose file name starts with the characters you input, the
message “Not Found” appears on the display. If this happens, press Qto clear
the error message.
3. Use fand cto highlight the file name of the program you want to recall and
then press 2(EDIT) to recall it.
7. Editing Program Contents
uu
uu
uTo edit program contents
1. Find the file name of the program you want in the program list.

136
Chapter 8 Programming
2. Recall the program.
•The procedures you use for editing program contents are identical to those used
for editing manual calculations. For details, see “Making Corrections”.
•The following function keys are also useful when editing program contents.
1(TOP) ........ Moves the cursor to the top of the program
2(BTM) ....... Moves the cursor to the bottom of the program
Example 2 To use the OCTA program to create a program that calculates
the surface area and volume of regular tetrahedrons when the
length of one side is known
Length of One Side (A) Surface Area (S) Volume (V)
7 cm cm2cm3
10 cm cm2cm3
15 cm cm2cm3
The following are the formulas used for calculating surface area S and volume V of a
regular tetrahedron for which the length of one side is known.
2
S = 3 A2,V= –––– A3
12
Use the following key operations when inputting the program.
Length of One Side A .. !W[1(?)aaA[3(:)
Surface Area S ............ !9d*aAx[[2(^)
Volume V ..................... !9c/bc*aAMd
Compare this with the program for calculating the surface area and volume of a
regular octahedron.
Length of One Side A .. !W[1(?)aaA[3(:)
Surface Area S ............ c*!9d*aAx[[2(^)
Volume V ..................... !9c/d*aAMd
P. 2 0
A

137
Programming Chapter 8
As you can see, you can produce the TETRA program by making the following changes
in the OCTA program.
•Deleting c*(underlined using a wavy line above)
•Changing dto bc(underlined using a solid line above)
Let’s edit the program.
2(EDIT)
eeeeDD
cd
138
Chapter 8 Programming
w
w
baw
w
8. Deleting a Program
There are two different ways to delete a file name and its program.
•Specific program delete
•All program delete
uu
uu
uTo delete a specific program
1. While the program list is on the display, use fand cto move the highlighting
to the name of the program you want to delete.
2. Press [1(DEL).
[1(DEL)
3. Press 1(YES) to delete the selected program or 4(NO) to abort the opera-
tion without deleting anything.
uu
uu
uTo delete all programs
1. While the program list is on the display, press [2(DEL•A).
1234

139
Programming Chapter 8
[2(DEL•A)
2. Press 1(YES) to delete all the programs in the list or 4(NO) to abort the
operation without deleting anything.
•You can also delete all programs using the MEM Mode. See “Clearing Memory
Contents” for details.
9. Useful Program Commands
In addition to calculation commands, this calculator also includes a variety of rela-
tional and jump commands that can be used to create programs that make repeat
calculations quick and easy.
Program Menu
Press !Wto display the program menu.
!W
1(COM) ...... Program command menu
2(CTL) ........ Control command menu
3(JUMP) ..... Jump command menu
[
1(?) ............. Input command
2(^)........... Output command
3(CLR) ........ Clear command menu
4(DISP) ...... Display command menu
[
1(REL) ........ Conditional jump relational operator menu
2(I/O) .......... Input/output command menu
3(:) .............. Multi-statement command
Press [to return to the previous menu.
1234
1234[
1234[
1234[
P. 3 7
P. 140
P. 140
P. 141
P. 141
P. 141
P. 142
P. 142

140
Chapter 8 Programming
Program Command Menu (COM)
While the program menu is on the display, press 1(COM) to display the program
command menu.
1(COM)
1(If) ............. If command
2(Then) ....... Then command
3(Else) ........ Else command
4(I•End) ...... IfEnd command
[
1(For) .......... For command
2(To) ........... To command
3(Step) ....... Step command
4(Next) ........ Next command
[
1(Whle) ....... While command
2(WEnd) ..... WhileEnd command
3(Do) .......... Do command
4(Lp•W) ...... LpWhile command
Press [to return to the previous menu.
Control Command Menu (CTL)
While the program menu is on the display, press 2(CTL) to display the control
command menu.
2(CTL)
1(Prog) ....... Prog command
2(Rtrn) ........ Return command
3(Brk) ......... Break command
4(Stop) ....... Stop command
1234[
1234
1234[
1234[

141
Programming Chapter 8
Jump Command Menu (JUMP)
While the program menu is on the display, press 3(JUMP) to display the jump
command menu.
3(JUMP)
1(Lbl) .......... Lbl command
2(Goto) ....... Goto command
3(⇒)........... ⇒(jump) command
[
1(Isz) .......... Isz command
2(Dsz) ......... Dsz command
Press [to return to the previous menu.
Clear Command Menu (CLR)
While the program menu is on the display, press [3(CLR) to display the clear
command menu.
[3(CLR)
1(Text) ........ ClrText command
2(Grph) ....... ClrGraph command
3(List) ......... ClrList command
Display Command Menu (DISP)
While the program menu is on the display, press [4(DISP) to display the dis-
play command menu.
[4(DISP)
1(Stat) ........ DrawStat command
2(Grph) ....... DrawGraph command
3(TABL) ...... Table & Graph command menu
Pressing 3(TABL) while the display command menu is on the display causes the
Table & Graph command menu to appear.
1234[
1234
1234[
1234

142
Chapter 8 Programming
3(TABL)
1(Tabl) ........ DispTable command
2(G•Con) .... DrawTG-Con command
3(G•Plt) ....... DrawTG-Plt command
Conditional Jump Relational Operator Menu (REL)
While the program menu is on the display, press [[1(REL) to display the
conditional jump relational operator menu.
[[1(REL)
1(=) ............. Relational operator =
2(
GG
GG
G
)............. Relational operator
GG
GG
G
3(>) ............. Relational operator >
4(<) ............. Relational operator <
[
1(≥)............. Relational operator ≥
2(≤)............. Relational operator ≤
Press [to return to the previous menu.
Input/Output Commands Menu (I/O)
While the program menu is on the display, press [[2(I/O) to display the input/
output command menu.
[[2(I/O)
1(Send) ...... Send ( command
2(Recv) ....... Receive ( command
1234
1234[
1234[
1234[

143
Programming Chapter 8
10. Command Reference
kk
kk
kCommand Index
Break .................................................................................... 149
ClrGraph ............................................................................... 153
ClrList.................................................................................... 153
ClrText ................................................................................... 153
DispTable .............................................................................. 154
Do~LpWhile ........................................................................... 148
DrawTG-Con, DrawTG-Plt ..................................................... 154
DrawGraph ............................................................................ 154
DrawStat ............................................................................... 153
Dsz ........................................................................................ 151
For~To~Next ..........................................................................147
For~To~Step~Next ................................................................147
Goto~Lbl ............................................................................... 151
If~Then ................................................................................. 145
If~Then~Else .........................................................................146
If~Then~Else~IfEnd ...............................................................146
If~Then~IfEnd ........................................................................145
Isz ......................................................................................... 152
Prog ...................................................................................... 149
Receive( ................................................................................ 154
Return ................................................................................... 150
Send( .................................................................................... 155
Stop ...................................................................................... 150
While~WhileEnd .................................................................... 148
? (Input Command) ................................................................ 144
^(Output Command) ........................................................... 144
: (Multi-statement Command) ................................................ 144
_(Carriage Return) ............................................................. 144
⇒(Jump Code) ..................................................................... 152
=,
GG
GG
G
, >, <, ≥, ≤(Relational Operators) ................................... 155
The following are conventions that are used in this section when describing the vari-
ous commands.
Boldface Text .............. Actual commands and other items that always must be in-
put are shown in boldface.
{Curly Brackets} ......... Curly brackets are used to enclose a number of items, one
of which must be selected when using a command. Do not
input the curly brackets when inputting a command.

144
Chapter 8 Programming
[Square Brackets] ....... Square brackets are used to enclose items that are op-
tional. Do not input the square brackets when inputting a
command.
Numeric Expressions . Numeric expressions (such as 10, 10 + 20, A) indicate con-
stants, calculations, numeric constants, etc.
Alpha Characters ....... Alpha characters indicate literal strings (such as AB).
kk
kk
kBasic Operation Commands
? (Input Command)
Function: Prompts for input of values for assignment to variables during program
execution.
Syntax: ? →<variable name>
Example: ? →A _
Description:
1. This command momentarily interrupts program execution and prompts for input
of a value or expression for assignment to a variable. When the input command is
executed, “?” to appears on the display and the calculator stands by for input.
2. Input in response to the input command must be a value or an expression, and
the expression cannot be a multi-statement.
^^
^^
^(Output Command)
Function: Displays and intermediate result during program execution.
Description:
1. This command momentarily interrupts program execution and displays alpha
character text or the result of the calculation immediately before it.
2. The output command should be used at locations where you would normally
press the wkey during a manual calculation.
: (Multi-statement Command)
Function: Connects two statements for sequential execution without stopping.
Description:
1. Unlike the output command (^), statements connected with the multi-statement
command are executed non-stop.
2. The multi-statement command can be used to link two calculation expressions or
two commands.
3. You can also use a carriage return indicated by _in place of the multi-statement
command.
__
__
_(Carriage Return)
Function: Connects two statements for sequential execution without stopping.
Other manuals for fx-7400G PLUS
10
Table of contents
Other Casio Calculator manuals

Casio
Casio MS-10VC User manual

Casio
Casio fx-570A User manual

Casio
Casio CFX-9850G PLUS User manual

Casio
Casio DF-120FM User manual

Casio
Casio FX-7700GE User manual

Casio
Casio ALGEBRA FX 2.0 User manual

Casio
Casio FX-7400GII User manual

Casio
Casio FX-180PA User manual

Casio
Casio MS-8B User manual

Casio
Casio MJ-12VC User manual

Casio
Casio fx-7400G User manual

Casio
Casio fx-82 Super User manual

Casio
Casio QA-300 User manual

Casio
Casio DR-210TM User manual

Casio
Casio CFX-9970G User manual

Casio
Casio fx-100MS User manual

Casio
Casio CFX-9970G User manual

Casio
Casio fx-991ZA Plus User manual

Casio
Casio HR-8TE User manual

Casio
Casio DJ-120D plus User manual