Beginner TI-92 BASIC
By Adam Berlinsky-Schine and Tavis Segura
An introduction to programming the TI-92 in BASIC

  • How to start by Adam (10/11/1997)
  • Accessing commands by Tavis (10/26/1997)
  • Input, Output, and Disp by Tavis (11/13/1997)


    Lesson 1: How to start

    The TI-92 is the hardest calculator to program BASIC. The easiest way to learn BASIC is by doing it. All I did to learn BASIC was read the instruction manual (I only had a TI-80 at the time) and then make lots of programs. Of, course, the first bunch were bad and very frustrating. With this course, I will try to eliminate some of that frustration and give you the basics on BASIC.

    As I said before, I think the best way to learn is by doing. But first I just need to give you a vew guidelines on working with the program editor. After this lesson, you will begin programming some programs.

    Going into the program editor To go into the program editor, press the APPS key (right below escape). Select 7: Program Editor, then 3:New. Then a menu should come up and the cursor should be on Program. Press down twice.Type in a name for the program, for now you can just use "test". Press enter (you may need to do it twice) and you will be in the program editor.The screen should look like this (with a menu on top):

    You would type all the code between Prgm and EndPrgm. If you wanted the user to have to type a variable in when he/she calls up the program inside the parenthesis, you would put a variable, such as x, inside the parenthesis in the first line. Then you could use that variable in the program.

    Typing code The TI-92 is the only calculator that lets you type in the code with letters. The other calculators make you find the command in various menus. This makes it faster to type in programs. However, it is easier to mess up by misspelling a word. Also, you don't have a list of all the commands you can use. A lot (but not nearly all) of the commands are listed in toolbars F2-F4.


    Lesson 2: Accessing Commands

    The TI-92 makes use of so many commands, it is difficult to remember the exact one you need while you are creating your program. Even if you know what commands you want to use, you can get tired of typing the same commands over and over. Fortunately, TI has created many different ways to find your commands and even save time typing.

  • The Keyboard: The keyboard accesses many different characters and even simple commands and structures. In the area above the number pad, you will find the trig functions, e^ and ln, parentheses (), brackets [], braces {}, and my personal favorite, the comma ,. Still more characters are found when you use the [2nd] key on other parts of the keyboard. You can see what some of them are by hitting the diamond key (the green one next to the ON button) followed by the letter k. Some provide international accents (a,e,o,u,n,c), greek (g), the imaginary number i (i), quotation marks (l), and the caps lock (z).

  • The Editor toolbar: This is where you are going to find the commands related to program flow, Input/Outut, variables, and changing the mode from within the program. In addition to that, it will allow you to save your program to another name, cut, copy and paste, and clear everything. It only appears in the program/function editor, so it is not of much use outside the editor (like in the text editor or the home screen).

  • The MATH popup: By hitting the [2nd] key followed by 5 (MATH), you will see several commands grouped with related ones. With the cursor, you can scroll down the list, select a category and get the command you need. If you prefer, you can also type the number corresponding to the category you want.

  • The CATALOG: Now for the big one... the Catalog. It is a list of every command in the calculator, in alphabetical order followed by the symbols. To get to a certain command, you can scroll down with the cursor, combine it with [2nd] to page down the list, or type the first letter of the command on the keyboard to skip to the commands beginning with that letter. Upon highlighting the command you are interested in, the syntax is given at the bottom of the screen in the small print.

  • Cut, Copy, Paste: Here's the best way to cut down on typing similar lines of code. You will find this in the toolbar under [F1]. Please take a look at it now. On the right side of the menu, you will find the corresponding keysrokes for it. Cut is diamond-X, Copy is diamond-C, and Paste is diamond-V. To use these, you move your cursor to the part of the program you want to select, hold down the shift key (the white arrow directly above the ON button) and use your sursor to highlight the text. Now you can use Cut or Copy to save the text. Now, whenever you have to type a similar command or text in another part of the program, you can just hit diamond-V to paste the command on your program and just edit it to suit your needs.


    Lesson 3: Input, Output, and Disp

    Disp: This command, is used to display words, numbers, and expressions on the Program I/O screen. You can view the I/O screen by pressing the [F5] key from the home screen. You can return to the home screen by pressing [F5] again, hitting [ESC], [2nd]-QUIT, or [diamond]-HOME. Here are a few things you can do with it:

       Typing nothing after Disp will just show the I/O screen.

       Following it with a string (a set of characters enclosed by quotation marks) will display the characters on the left, starting from the top line.

       Typing an expression or number after Disp will evaluate the expression and display the answer.

    You can also follow it by any combination of the above, separated by commas, to type several things in succession. It will start a new line for each expression.

    Here's an example:

    Disp "Hi there",Hi there,12456,45*10,{"Yo",3.11}

    The above command will take you to the I/O screen and have a display like this:

    Note that Disp will use "Pretty Print" whenever you have it on and will show the expressions just like it would on the Home screen.

    Input    This command works the same way in all the TI-XX graphing calculators: It will let a user type something on the calculator during the program, and then save it. When you type a variable name after it, it will take the user to the I/O screen, wait for that user to type an expression, and finally save the input under the variable name you used. Go ahead and try it now. Just enter your program "test" by pressing the [APPS] key, selecting 7: Program Editor, and selecting 2: Open... . From there, you will see a box similar to the one you used to create "test". Press the down arrow twice and right once. Select "test" in the menu next to "Variable:" and press enter TWICE. Then you will see that familiar screen. Go ahead and type the following in the calculator:

    :test()
    :Prgm
    :Input a
    :Disp a*5
    :EndPrgm

    Now, get back to the home screen (diamond-q, [2nd]-QUIT, or [APPS]-1). Once you get to the home screen, type test() and press [ENTER]. You will immediately be sent to the Program I/O screen and see a question mark on the top of the screen with the cursor directly below it. Go ahead and type a number. When you press [ENTER], the calculator will display the number times five.

    Now to revise that nice little program. Press [APPS], 7: Program Editor again, but this time press 1: Current. This feature will immediately take you to the last porgram you edited, "test". Move your cursor to the line containing Input. This time make that line say:

    :Input "Type a number:",a

    Go back and run it again. This time the question mark is replaced with the phrase "Type a number:" and your cursor still appears below it. This allows you to ask for a particular type of input. For using strings, the alternative command is InputStr. It behaves exactly like Input but it saves the input as a string of characters.

    *NOTE* If you type nothing after Input, it will enter the graph screen and let you use your cursor to select xc and yc, the "current" x and y coordinates. When you use it, [ENTER] updates xc and yc, and [ESC] will cancel the changes. I will go into more detail about this later.

    Output    This command is kind of like Disp, but it does something a little more interesting: it puts your answer anywhere on the Program I/O screen. The only problem is, it takes a while to get accustomed to the way Output works: Type the command, the row number and column number, and finally the number, expression, or variable. Because of the TI-92's ability to write in "Pretty Print", expressions can be very unpredictable, and the row and column numbers are counting pixels, not characters (for those of you who have seen programs for the other calculators.) You have to multiply the rows by 8 and the columns by 6 in order to line up letters straight. This does have its advantages, though. On the TI-92, letters can be placed in strange places, allowing superscript and subscript (just subtract or add a few rows) and partially overlapping letters.

    You can hit [CLEAR] on the I/O screen or type the command ClrIO on the Home screen to erase everything from the Program I/O screen.