beautypg.com

Variables, Creating a variable, Variables -2 – HP 49g Graphing Calculator User Manual

Page 146: Creating a variable -2, Store

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

background image

Variables

Variables enable you to store and retrieve objects. You do this by giving an

object a name. For example, if you regularly use a particular number in
calculations—say, 9.81 m/s^, the acceleration of gravity—you can create a

variable that associates this number with a name.

Variable names can be up to 127 characters long and can contain letters,
digits, and most other characters. You could, for example, call 9.81 m/s- G,
Gl, or GRAY. Then when you need to use 9.81 m/srin a calculation, you
can enter the variable name, or select it from a menu.

Some characters cannot be included in a variable name. These are:

® characters that separate objects: space, period, comma, @

® object delimiters: # [ ] “ ‘ f ) ( ) : _ « »

® mathematical symbols; for example, + -*/ ^ + <>

= < > ^ d I

Also, you cannot use a command name or a menu name as the name of a
variable.

You can store any type of object in a variable: numbers, character strings,

equations, programs, graphics, and so on.

Creating a variable

1. Enter the data that you want to associate with a variable.

2. Press (§To>) to select the

STORE

command.

3. Enter a name for the variable. (See chapter 2, “Basic operation”, for

information on how to enter alphabetic characters.)

4. Press (MEB) to create the variable.

For example, to create a variable named GRAY to store the value 9.81,

enter the following on the command line:

9.81 (Sro»)

GRAY

See “Creating a directory” on page 7-6 for details of another method of
creating variables.

Page 7-2

Storing objects