Programming · beginner
TI-BASIC Programming on the TI-84: Write Your First Program
TI-BASIC is built into every TI-84 Plus and TI-84 Plus CE. There is nothing to install and no compiler to run: you create a program, paste commands into it, and the calculator works through them from the first line downwards. The PRGM key is the door to all of it.
The reasons to learn it are modest and practical. A short program can run a calculation you repeat every week, or hold a routine you would otherwise retype from memory. It is also the clearest way to see what the calculator is doing, because a TI-BASIC listing is plain enough to read line by line.
Creating a program from PRGM ▸ NEW
- Press PRGM. The program menu opens on its EXEC, EDIT and NEW page. The arrow keys move you between that page, the CTL menu and the I/O menu.
- Move the cursor to the NEW entry and press ENTER. The calculator displays
Name=and switches alpha-lock on, so the letter keys type letters without you holding ALPHA. - Type a name, then press ENTER. The editor opens with a single colon on line 1, waiting for the first command.
A program name can be one to eight characters long. The first character must be a letter from A to Z, or the theta symbol; the second to eighth characters can be letters, numbers or theta. Names hold no spaces and must be unique on that calculator, because the name is how you call the program later.
Name=QUAD
After PRGM ▸ NEW
The commands live in the menus, not in your fingers
TI’s own teaching material is blunt about this: the programming commands cannot be typed. Disp typed as the letters D, I, S and P is read as four variables multiplied together, not as a display instruction. Every keyword is a token that you paste from a menu, and the menu is where you learn its correct spelling.
Two pages of the PRGM menu hold most of what a beginner needs:
- The CTL menu holds program flow:
If,Then,Else,For(,While(,Repeat,End,Pause,LblandGoto. Menu path: PRGM ▸ CTL ▸ 1:If. - The I/O menu holds input and output:
Input,Prompt,Disp,Output(,DispGraph,getKeyandClrHome. Menu path: PRGM ▸ I/O ▸ 3:Disp.
Read the labels on your own screen as you work. The numbering inside each menu is stable on a given model, but menu layouts have changed between models and operating system versions.
DISP, INPUT, PROMPT and PAUSE
| Command | What it does | Notes |
|---|---|---|
Disp | Prints text or a value on the home screen | Text sits on the left; a value placed after text moves to the next line, right-aligned |
Input | Waits for you to type a value | Input "A=",A shows the prompt A= and stores what you type |
Prompt | Asks for several variables in turn | Prompt A,B,C asks three questions, one after another |
Pause | Freezes the display | Wait for ENTER, or give a time in seconds as in Pause 3 |
Output(row,column,value) is a third way to print. It puts a value at an exact spot on the screen, which lines up a table of results neatly, and it does not scroll the screen the way Disp does.
Storing with the arrow and displaying with DISP
The store arrow, typed with STO▸, writes a value into a variable and prints nothing while a program is running. Disp prints a value without storing it. Confusing the two is the most common reason a first program appears to do nothing: it calculates correctly and then discards the answer in silence.
:B²-4AC→D stores the discriminant in D. :Disp D shows it. Neither line is optional if the reader is to see the answer.
Control flow: If, For( and While(
Three structures carry nearly all of it.
- A single-line
Ifguards the line beneath it::If X<0followed by:Disp "NEGATIVE"prints the message only when X is negative. - A block
IfusesThenandEnd, with an optionalElsein the middle::If D<0,:Then,:Disp "NO REAL ROOTS",:Else, and a closing:End. For(repeats a counted number of times::For(I,1,5)with the body and then:End. A fourth argument sets the step, as in:For(I,0,1,0.1).While(repeats until a condition stops being true::While(X<10), body,:End.
Every Then, For( and While( needs its own End. Leave one out and the calculator refuses to run the program, offering 2:Goto on the error screen so that you can jump to the line it objected to. That screen is the one covered in our ERR: SYNTAX guide.
ERR: SYNTAX
1:Quit
2:Goto
Running a program with an unclosed block
A complete program: a quadratic solver
Here is a whole program that solves a quadratic equation and prints both real roots. Enter the coefficients as A, B and C, using the (-) key for negatives.
PROGRAM:QUAD
:ClrHome
:Prompt A,B,C
:B²-4AC→D
:If D<0
:Then
:Disp "NO REAL ROOTS"
:Else
:Disp "X1=",(-B+√(D))/(2A)
:Disp "X2=",(-B-√(D))/(2A)
:End
The first line is the header that TI prints for a listing; it names the program and is not a command. After that, line by line:
ClrHomeclears the home screen so the output starts on a blank page.Prompt A,B,Casks for the three coefficients and stores the answers in the variables A, B and C.B²-4AC→Dcomputes the discriminant and stores it in D. Multiplication is implied, so4ACmeans 4 times A times C. Working the discriminant out once keeps the next two lines short and makes them easier to check.If D<0tests the discriminant, and theThenturns the test into a block that covers more than one line.Disp "NO REAL ROOTS"handles the case where the equation has no real solutions, which is exactly why the block was needed.Elsestarts the branch that runs in every other case.(-B+√(D))/(2A)is the quadratic formula with a plus sign. The leading minus comes from the (-) key at the left of the keyboard, not from the subtraction key, and the square root is 2nd x².Disp "X1=",(-B+√(D))/(2A)prints the label and then the value, and the secondDispprints the other root.Endcloses the block. Without it the program will not parse.
Run it with A=1, B=-5 and C=6. The discriminant is 1, the roots are 3 and 2, and the screen ends like this:
X1=
3
X2=
2
Done
PRGM ▸ EXEC ▸ QUAD
Running, editing and deleting a program
- Run it from PRGM ▸ EXEC: press PRGM, select EXEC, move the cursor onto the program name and press ENTER. Once you know the name, typing it on the home screen is quicker.
- Edit it from PRGM ▸ EDIT: select EXEC’s neighbour, choose the program name, and the listing opens at the top. Insert a line with 2nd DEL (the INS key), empty a line with CLEAR, remove one with DEL, and leave the editor with 2nd MODE.
- Delete it from the PRGM menu. Open the delete entry in the program menu, or reach the same list through the memory-management menu, move the cursor onto the program, press DEL, then confirm the prompt with
2:Yes.
Archiving, and the rules that apply before a test
Archiving moves a program out of RAM and into the calculator’s Flash memory, so it survives a RAM clear. The memory-management menu lists your programs, marks archived items with an asterisk and toggles the state when you press ENTER. An archived program has to be unarchived before you can edit or run it, and it does not appear in every file list.
Many teachers ask for programs, apps and notes to be removed before a test, and some exam settings go further. Press-to-Test mode hides programs, applications and variables without deleting them: a teacher enables it before the paper and clears it afterwards. Rules are set by the exam board and by your school, and they are revised from time to time, so confirm the current position with your teacher or the official board. Our overview of whether TI-84 calculators are allowed explains how the SAT, ACT, AP and IB treat the family.
If a reset has already wiped a program you wanted, our factory reset guide shows what a reset clears, and once a program is working, finding the mean, median and mode makes a good second exercise to program.
Frequently asked questions
Can I type a command such as Disp as letters in a program?
No. TI-BASIC keywords are tokens that you paste from a menu, and the letters D-I-S-P typed by hand are read as four variables multiplied together. Open the PRGM I/O menu and select Disp instead. The same rule applies to every command in the language.
My program runs but shows nothing. What went wrong?
You probably stored the answer with the store arrow and never displayed it. The arrow writes a value into a variable silently, while Disp prints it. Add a line such as Disp X at the point where you want the reader to see the result.
Do programs survive when the calculator is switched off?
Yes. Switching off does not clear memory. Programs are lost by a RAM reset, by Clear All in the PRGM menu, or by removing the AAA batteries while the round backup cell is also flat. Archive anything you would be upset to lose.
Do I need a TI-84 Plus CE to write TI-BASIC?
No. The TI-84 Plus and the TI-84 Plus CE run the same language and the same editor. The CE adds colour to the screen and has more room for programs, but a listing written on one model runs on the other apart from the optional colour tokens.
Official references
Statements on this page are checked against the manufacturer or exam authority documentation below. Where an official source and this page disagree, the official source wins.