Casio CFX-9850G PLUS Operating instructions

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

352
20-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.
•{EXE}/{EDIT} ... program {execute}/{edit}
•{NEW} ... {new program}
P. 368 •{DEL}/{DEL·A} ... {specific program}/{all program} delete
P. 362 •{SRC}/{REN} ... file name {search}/{change}
•{LOAD}* ... {loads a built-in Program Library program}
*See the separate Software Library Manual for details (except fx-
9750G PLUS, CFX-9850G PLUS).
*The following models do not support the LOAD command: fx-9750G
PLUS, CFX-9850G PLUS.
•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.
The values to the right of the program list indicate the number of bytes used up
by each program.
File Name
Program
File Name
Program
File Name
Program
CFX
Selected memory area
(use
f
and
c
to move)

353
20-2 Programming Examples
Example 1 To 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.
A
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. Display the program list menu and press 3(NEW) to display a menu, which
contains the following items.
•{RUN}/{BASE} ... {general calculation}/{number base} program input
P. 360 •{
QQ
QQ
Q} ... {password registration}
•{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, r,
θ
, spaces, [, ], {, }, ’, ”, ~, 0 through 9, ., +, –, ×, ÷
•Note, however, that vand .cannot be input for the name of a program
that contains binary, octal, decimal, or hexadecimal calculations.

354
•Use 1(RUN) to input a program for general calculations (a program to be
executed in the COMP Mode). For programs that involve number system
specifications, use 2(BASE). Note that programs input after pressing 2
(BASE) are indicated by
B
to the right of the file name.
•Pressing 6(SYBL) displays a menu of symbols ( ’, ”, ~ ) that can be input.
•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.
File name
•Registering a file name uses 17 bytes of memory.
•The file name input screen remains on the display if you press wwithout
inputting a file name.
•To exit the file name input screen and return to the program list without
registering a file name, press J.
•When you register the name of a program that contains binary, octal, decimal,
or hexadecimal calculations, the indicator
B
is appended to the right of the file
name.
uu
uu
uTo input a program
The following items are included in the function menu of the program input screen,
which is used for program input.
P. 365 •{TOP}/{BTM} ... {top}/{bottom} of program
P. 364 • {SRC} ... {search}
• {MENU} ... {mode menu}
• {SYBL} ... {symbol menu}
uu
uu
uTo change modes in a program
•Pressing 4(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.
•{STAT}/{MAT}/{LIST}/{GRPH}/{DYNA}/{TABL}/{RECR}
For details on each of these modes, see “To select an icon”, as well as the
sections of this manual that describe what you can do in each mode.
•The following menu appears whenever you press 4(MENU) while inputting a
program that involves number base specifications.
•{d ~ o}/{LOG}
20 - 2 Programming Examples
P. 3

355
•Pressing 6(SYBL) displays a menu of symbols ( ’, ”, ~, *, /, # ) that can be
input into a program.
•Pressing !Zdisplays a menu of commands that can be used to change
set up screen settings inside a program.
•{ANGL}/{COOR}/{GRID}/{AXES}/{LABL}/{DISP}/{P/L }/{DRAW}/{DERV}/
{BACK}/{FUNC}/{SIML}/{S-WIN}/{LIST}/{LOCS }/{T-VAR}/{ΣDSP}/{RESID}
P. 5 For details on each of these commands, see “Set Up Screen Function Key
Menus”.
The following function key menu appears if you press !Z while inputting a
program that contains binary, octal, decimal, or hexadecimal calculation.
•{Dec}/{Hex}/{Bin}/{Oct}
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
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
commands 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 com-
mand is: ? →<variable name>.
^^
^^
^:This command pauses program execution and displays the last calculation
result obtained or text. It is similar to pressing win a manual calculation.
P. 369 •For full details on using these and other commands, see “Useful Program
Commands”.
Programming Examples 20- 2

356
The following shows examples of how to actually use the ? and ^commands.
!W4(?)aaA6(g)5(:)
c*!9d*aAx
6(g)5(^)
!9c/d*aAMd
!Q or JJ
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
1(EXE) or w
hw
(Value of A)
Intermediate result produced by
^
ww
baw
20- 2 Programming Examples

357
w
··
··
··
··
··
··
•Pressing wwhile the program’s final result is on the display re-executes the
program.
P. 378 •You can also run a program while in the RUN Mode by inputting:
Prog ”<file name>” w.
•An error occurs if the program specified by Prog ”<file name>” cannot be
found.
Programming Examples 20- 2

358
20-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
debugging 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
P. 436 error was generated, along with the cursor. Check the “Error Message Table” for
steps you should take to correct the situation.
P. 360 •Note that pressing dor ewill not display the location of the error if the
program 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
P. 365 contents of the program and make necessary changes. See “Editing File Names
and Program Contents” for details on how to change program contents.

359
20-4 Calculating the Number of Bytes Used by a
Program
There are two types of commands: 1-byte* commands and 2-byte* commands.
*Abyte is a unit of memory that can be used for storage of data.
• 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
P. 2 4 Mode. See “Memory Status (MEM)” for details.

360
20-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
programs 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 5(Q) and then input the password.
5(Q)
CASIO
P. 353 •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.
uu
uu
uTo recall a program
Example To 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.
Other manuals for CFX-9850G PLUS
26
This manual suits for next models
4
Table of contents
Other Casio Calculator manuals

Casio
Casio FR-1011S User manual

Casio
Casio CFX-9970G User manual

Casio
Casio DC-150A User manual

Casio
Casio FX-9750G User manual

Casio
Casio ALGEBRA FX 2.0 User manual

Casio
Casio FX-7700GB User manual

Casio
Casio MS-10VC User manual

Casio
Casio FX-9750G User manual

Casio
Casio fx-50F User manual

Casio
Casio MS-7UC User manual

Casio
Casio CFX-9850G PLUS Instruction sheet

Casio
Casio fx-CG50 User manual

Casio
Casio fx-CG50 User manual

Casio
Casio FX-6300G User manual

Casio
Casio fx-7400G User manual

Casio
Casio FX-CG10 User manual

Casio
Casio FX-992VB User manual

Casio
Casio FX-82TL User manual

Casio
Casio ALGEBRA FX 2.0 User manual

Casio
Casio MS-8E User manual





















