The Basics of Variables

A variable is a place where a number can be stored. If you look at the keyboard of your calculator, you'll see a little green letter next to nearly every key. You can type these letters by pressing ALPHA and then pressing the key next to the right letter. Each of the letters A through Z (as well as the funky θ symbol, which is Greek and pronounced "theta") is a variable that can hold a number.

If you just type any of these variables on the home screen, and press ENTER, you'll most likely get the value 0 back. That means that the number stored in that variable right now is 0. But you can change this! Right above the ON key is the STO▶ key, which can be used to insert the → arrow. This arrow is called the store command, because it can be used to store a number to a variable. Just type, for example, 5→A, and press ENTER, and the value 5 will be stored in the variable A.

Now, if you type A, you should get the number 5 back instead of 0. The number 5 will be saved to the variable A for as long as you need it, until you store something else to A (this is done in the same way).

Variables can be used nearly everywhere that numbers can. When using your calculator for math, you might type something like 2+3/8 and the calculator will compute the result. Variables can be used the same way: A+B/C will do the math using the variables A, B, and C, just like it used the numbers 2, 3, and 8 in the previous case.

As you've seen, variables are not necessarily linked to programs on the calculator, they work just fine on the home screen. But they are very important in programs, because they are the only kind of memory your calculator has. Imagine you're explaining how to solve a math problem (and writing a program is a lot like explaining a math problem!) You might need to say something like, "Now multiply these two numbers together." Variables, in TI-Basic, and indeed in any programming language, are what you use to say these two numbers.

More on the Subject

A larger look at variables in TI-Basic can be found here.

<< Downloading Programs Table of Contents Input and Output >>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License