There are a few different ways to display text and values to the screen in TI-Basic. These includeDisp,Output,Pause andText. We'll cover each of their uses and their syntaxes.
Disp (PRGMI/O 3) displays text or values to the home screen. It creates a new line on the home screen and prints the text left-aligned for strings, and right-aligned for values.
Disp [valueA,valueB,valueC,...,valueN]
To printStr1 to the home screen:
To printX to the home screen:
To print a literal string or value to the home screen:
There can be multiple expressions or variables with each having its own line:
An example of a simple program that usesDisp:
THE VALUE OFX IS 3.14
If you try to print a string or value that is longer than 16 tokens, it will be trimmed and appended with an ellipse:
If no arguments are added, the home screen is displayed.
THE VALUE OF X ... 3.14
Pause (PRGMCTL 8) freezes the program mid-execution and can optionally display text as well. When a pause token is reached in the program, execution pauses until the user pressesENTER to resume. If text is passed as an argument, the specified text will be displayed.
:Pause [value]:Pause [value,time]
Some examples ofPause:
Text displayed withPause can longer than 16 tokens. However, you will need to use the left and right arrow keys to scroll along the text. If no text is provided, the program will simply pause untilENTER is pressed:
Text (2ND[DRAW]DRAW 0) draws small font text to the graph screen. It has precise X and Y coordinate positioning, and can print several values or strings.
Text(row,column,text1,text2,...,text n)
Some examples of usingText:
If the first argument passed is-1,Text will draw with the standard font:
Output (PRGMI/O 6) is used for displaying values or strings on the home screen.Output will override anything that the displayed characters may overlap with that is previously on the screen.
Output(row,column,"text")Output(row,column,value)
In this example, the calculator would displayWIKIBOOKS at 2 rows down (from the top of the screen) and 6 columns over (from the left of the screen). Notice that to display a string, the string must be enclosed in quotation marks. Make sure to separate values of row column and display value with commas.
Previous:Basic Variables
Next:Input
Table of Contents:TI-Basic Z80 Programming