Save the edited version of SPH in the variable. Then, to verify that the changes were saved, view SPH in the command line.

`J!%SPH% @%SPH% ˜

Press to stop viewing.

Creating Programs on a Computer

It is convenient to create programs and other objects on a computer and then load them into the calculator.

If you are creating programs on a computer, you can include “comments” in the computer version of the program.

To include a comment in a program:

Enclose the comment text between two @ characters. or

Enclose the comment text between one @ character and the end of the line.

Whenever the calculator processes text entered in the command line — either from keyboard entry or transferred from a computer — it strips away the @ characters and the text they surround. However, @ characters are not affected if they’re inside a string.

Using Local Variables

The program SPH in the previous example uses global variables for data storage and recall. There are disadvantages to using global variables in programs:

After program execution, global variables that you no longer need to use must be purged if you want to clear the VAR menu and free user memory.

You must explicitly store data in global variables prior to program execution, or have the program execute STO.

Local variables address the disadvantages of global variables in programs. Local variables are temporary variables created by a program. They exist only while the program is being executed and cannot be used outside the program. They never appear in the VAR menu. In addition, local variables are accessed faster than global variables. (By convention, this manual uses lowercase names for local variables.) A compiled local variable is a form of local variable that can be used outside of the program that creates it. See “Compiled Local Variables” on page 1-10 for more information.

Creating Local Variables

In a program, a local variable structure creates local variables.

To enter a local variable structure in a program:

1.Enter the → command (press ).

2.Enter one or more variable names.

3.Enter a defining procedure (an algebraic or program object) that uses the names.

«name1 name2 namen ' algebraic ' »

or

«name1 name2 namen « program » »

When the → command is executed in a program, n values are taken from the stack and assigned to variables name1 name2, …. namen.

RPL Programming 1-7