TI-Basic 89 Programming/Input


Input, I/O(F3):3 is a command which will display a string and wait for the user to input a value. The value will then be stored into the specified variable once Enter is pressed. The behavior of this command changes depending on how many parameters are passed into it, as explained below.

Syntax: InputEdit

:Input [string],[var]
  • Where string is the optional string to display, and var is the optional variable to store the value to
  • If string is provided, the I/O screen will display that string on a new line, then wait for user input.
  • If string is not provided, the I/O screen will display a ? on a new line, then wait for user input.
  • If neither string nor var is provided, it will display the graph screen and wait for the user to select a coordinate (x value of coordinate is stored into xc, and the y value into yc)
  • Providing only string but not var results in an error ("Argument must be a variable name", errornum 140)

Example: With stringEdit

:Input "X Value",x

X Value
*The value of 5 would be stored into x

Example: Without stringEdit

:Input x

*The value of 5 would be stored into x

Example: Without argumentsEdit


Pressing Enter here would store the coordinates into xc and yc, respectively.


InputStr, I/O(F3):4 is much like input, but the values input into this command will always be a string (thus no quotation marks are needed).

Syntax: InputStrEdit

:InputStr [string],var
  • Where string is an optional string to display instead of
  • Where var is the variable the string input will be stored into

Example: InputStrEdit

:InputStr "What is your name",name

What is your name
*Pressing Enter would store "George" into the variable name.


Prompt, I/O(F3):5 prompts the user to input a number of variables. While this can be used to input more than one variable with one command, it does not give you the flexibility to change what is displayed on screen.

Syntax: PromptEdit

:Prompt var[,var2][,var3][,…varN]
  • Where var2 through varN are all optional arguments; arguments must be valid variable names.
    • Amount of arguments limited only by available memory
  • For each argument, the prompt will wait until a value is entered and Enter pressed before asking for the next one.

Example: PromptEdit

:Prompt x,y

*This would store 5 into x and 7 into y


Request, I/O(F3):1:2 puts a pop-up box on the current screen and allows the user to input a string into it, and then stores that string into a variable. Request can be used as a stand-alone command or as part of a Dialog block (more on those later).

Syntax: RequestEdit

:Request string,var
  • Where string is the string to be displayed before the input box
  • Where var is the variable the string gets stored into
  • Request automatically turns a-lock on, so the alpha button must be pressed once before numbers and other symbols may be entered

Example: RequestEdit

:Request "name",x

The string put into the input box will be stored into the variable x.


PopUp, I/O(F3):1:3 displays a pop up window with a number of choices for the user to choose between (passed in as a list). Then, the number of the choice the user selects will be stored into the variable given.

Syntax: PopUpEdit

:PopUp itemlist,var
  • Where itemlist is a list of strings that will appear in the popup.
  • Where var is the variable that the number of the choice will be stored to.

Example: Correct equationEdit

:PopUp {"1+2=2","1/2=2","1-2=2","1*2=2"},x

When Enter is pressed, the value 4 will be stored into x.

Passing in ArgumentsEdit

Passing in arguments is vital to functions, and can be helpful in programs as well. In order to get an argument to be passed in, it must be declared in the opening parenthesis of the program editor. Then, when calling the program (by typing prgmname() in the home screen), you put the declared arguments into the parenthesis, like so: prgmname(arg). Note: for all of the following examples, the name of the function is "temp" (and it is a function).


  • Where var1 through varN are all valid variable names
    • The amount of variables passed into the function is limited only by the amount of available memory
  • The variables passed in are local variables, as in they disappear the moment program execution stops (unlike from the previous ways of input, where the variables stick around until they are deleted).

Example: TempEdit

Return x^2+(y*z)/100

Let's say you call this program like so: temp(12,4,52). The following will appear on your home screen:

▪temp(12,4,52)      146.08

Previous: Output
Next: Conditional Functions
Table of Contents: TI-Basic 89 Programming