Skip to content
Property Value
Hex Value $93
Categories
Localizations
  • FR: Texte(

Text(

Overview

Writes text on graph beginning at pixel (row,column), where 0 ≤ row ≤ 164 and 0 ≤ column ≤ 264.
Full mode, row must be <=148; column must be 256
Horiz mode, row must be row<=66 and column must be <=256
G-T mode, row must be row <=126; column must be 176

Availability: Token available everywhere.

Syntax

Text(row,column,text1,text2,...,text n)

Arguments

NameTypeOptional
row
column
text1string
text2string
...
text nstring

Location

2nd, draw, DRAW, 0:Text(


Description

The Text( command allows you to display text on the graph screen, using the small font. It takes three arguments: the row, which can range from 0 to the number of pixels tall the screen is (62 on grayscale, 164 on color) at which you want to display something, the column, which can range from 0 to the number of pixels wide the screen is (94 on grayscale, 264 on color), and whatever it is you want to display. Like the Output( command, it is limited to numbers and strings. If part of what you want to display goes off the screen, it will not be displayed - the calculator will cut you off at the most characters that will fit on the screen entirely.

Unlike the large text used on the home screen, the small font this command uses varies in width from 2 pixels to as many as 6 (counting the blank space at the end of each character, which is 1 pixel). All characters are 6 pixels tall, but the top row of pixels is used very rarely (only in international characters such as ä). On the TI-84+/SE/CSE/CE, the Text( command may also erase a single row of pixels underneath the text: whether this occurs or not depends on whether it was the menu screen or the table that was visited last, of the two.
Without storing them to a special string, the Text( command cannot be used to display quotation marks (") and the STO (→) command. However, you can mimic these respectively by using two apostrophes (' ' ), and two subtract signs and a greater than sign (—>).

Like many other drawing commands, if you're outside a program and on the graph screen, you can use this command directly, without going to the home screen. Just select Text( from the draw menu, and you will be able to type text at a cursor you control with arrow keys; press CLEAR or ENTER (among other things) to exit this mode.

Advanced Uses

On the TI-83/84/+/SE/CSE/CE, Text( has an alternate syntax: put a -1 before the row and column to display the text using the large font instead of the small font. With this syntax, Text( becomes like an Output( for the graph screen, but with more features: you don't have to display text exactly aligned to one of the home screen's rows and columns, and you can display more than one string or number at a time. Also, text still won't wrap like Output('s does.

This feature may be helpful in making programs more appealing, but remember that it does not work on the regular TI-83. If you want to maintain compatibility, don't use this syntax, or make an alternate version of your program without it.


The Text( command is also critical to the sprite technique known as text sprites. Although they have limitations, they allow pure Basic programs to have high-quality graphics without taking up lots of space. This effect is not as good on the color calculators.


On the TI-84+ and TI-84+ SE, another compatibility issue occurs with Text(. On certain occasions, using Text( to display small text on the graph screen will erase a 1-pixel margin below the text itself. The cause is a system option which is turned on when accessing the new MODE menu, and turned off when accessing the table, matrix editor, or list editor. The 1-pixel margin may not seem like a big deal, but it's enough to stop certain games (such as Bryan Thomas's Contra) from working on the TI-84+/SE.

The situation can be detected quite easily: turn on a pixel, display text 6 rows above it, and test if the pixel is still turned on. Fixing the situation is slightly more difficult:

  • The hex code AsmPrgmFDCB058EC9 will disable the option (but it requires having an additional subprogram).
  • DispTable will also do the trick, but of course it will display the table as well.
  • Switch the program to G-T while it's on the graphscreen. Before doing this it's useful to have a FnOff.
    • The above two don't work in resetting the flag on OSes 2.53 MP or higher, the hex code is required.
  • There's the option of telling users to access a certain screen before playing…

You can also try to get around the situation by storing and recalling pictures, to prevent anything from being erased when you don't want it to be.

Error Conditions

  • ERR:DOMAIN is thrown if the coordinates of Text( are not integers or are out of range. A few comments:
    • ERR:DATA TYPE can sometimes occur instead on the TI-83+ or higher because of confusion with the alternate syntax
    • Similarly, Text(-1,0,0) will cause no error and display nothing whatsoever on the TI-83+ or higher.
    • With Text(-1,… the upper bound on the row is one less of what it would be normally.
    • In Horiz mode the upper bound on the row is 25 rather than 57. In G-T mode the upper bound on the column is 46.
  • ERR:ARGUMENT is thrown if the number of arguments given to Text( is 256 or more or if one of the arguments contains an imaginary part. The latter restriction can be bypassed with clever programming. One such method is displayed here: <complex number>:Text(x,y,real(Ans),sub(“+-“,1+(imag(Ans)<0)),imag(Ans),”i

Source: parts of this page were written by the following TI|BD contributors: burr, DarkerLine, Edward H, GoVegan, iPhoenixOnTIBD, Ivoah, kg583, mattyjraps, Myles_Zadok, Timothy Foster, ztrumpet.

History

Calculator OS Version Description
TI-82 1.0 Added
Authors: Adrien Bertrand