Running A Program - Casio fx-CP400 User Manual

Table of Contents

Advertisement

When program execution returns to the main program, it resumes from the point immediately after the
command that jumped to the subroutine.
Example 1:
Main Program:
Jumps to subroutine program "Sub1"
Example 2:
Main Program:
Assigns the values of main program variables "A" and "B" to the parameter
variables (D and E) in subroutine "Sub2", and then jumps to subroutine "Sub2".
Using Strings in a Program
A string is a series of characters inside of quotation marks. In a program, strings are used to specify display
text. A string made up of numbers (like "123") or an expression (like " –1") cannot be processed as a
calculation.
Tip:
To include quotation marks (") or a backslash (\) in a string, put a backslash (\) in front of the quotation marks (") or
backslash (\).
Examples:
To include Japan: "Tokyo" in a string
Print "Japan:\"Tokyo\""

Running a Program

Example: To run the "OCTA" program created under "Creating a Program" (page 190) to calculate the surface
areas and volumes of three regular octahedrons, the lengths of whose sides are 7, 10, and 15
u To run a program
1. On the Program Loader window, specify the program you want to run.
(1) Tap the [Folder] down arrow button, and then select the folder you want.
(2) Tap the [Name] down arrow button, and then tap the name of the file.
Here, we will tap "OCTA".
• In this example, the "Parameter" input box is left blank. For information
about using the "Parameter" input box, see "Configuring Parameter
Variables and Inputting Their Values When Creating a Program" (page 191).
2. Tap ., or tap [Run] and then [Run Program] to run the program.
• This runs the program and displays a dialog box prompting for input of a value for variable A (length of one
side).
Subroutine: "Sub1"
Subroutine: "Sub2"
To include main\abc in a string
Print "main\\abc"
Chapter 12: Program Application
192

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Classpad ii

Table of Contents