Jump to content

TI-Basic 84 Programming/Output

From Wikibooks, open books for an open world

Disp, PRGM:I/O:3 is a command which will display a number, string, equation or other type of variable/literal given as arguments. Disp can accept an unlimited number of arguments separated by commas (although it recommended to keep the number of arguments under 7 for monochrome calculators and 9 for color calculators because after that, for each consecutive argument the screen pushes everything else up past the top of the screen), and will display each argument following the previous line.

Syntax: Disp

[edit | edit source]
:Disp [arg][,arg2][,arg3][,arg4][,…argN]
  • Where arg,arg2,arg3,arg4 and all other arguments through argN are optional parameters. The number of arguments is only limited by the calculator memory. The arguments can be either a literal or variable of any type, except for Pic0-Pic9 and GDB0-GDB9.
  • For each argument, Disp displays the argument on the next line, starting from where the cursor initially was located. If the display reaches the last line, the display will 'scroll' the rest of the screen up so that the argument can be displayed.
    • If an argument is a number, Disp displays it right-aligned
    • If an argument is a string:
      • it will display it left-aligned
      • if the string contains more than 16 characters string will be truncated and will display "..." at the end of the string
    • If an argument is too long to be displayed, the argument will be truncated and three dots will be placed at the end indicating such
  • If no argument is specified, the command just displays the home screen


Ex: Display Lines

[edit | edit source]

Assuming you have a homescreen like this,

5→X
               5
X+1
               6

and you executed this program,

Disp "HELLO WORLD",52,X+1

you would have the following:

               5
X+1
               6
pgrmTEMP
HELLO WORLD
              52
               6
            Done

Ex: Empty Lines

[edit | edit source]
Disp "","","HELLO WORLD"

HELLO WORLD

Ex: Truncated

[edit | edit source]
Disp "THIS LINE IS TOO LONG FOR ONE LINE"
THIS LINE IS TO…

Pause

[edit | edit source]

Pause, PRGM:8 displays an argument, then pauses execution afterwards.

Syntax: Pause

[edit | edit source]
:Pause [value]
:Pause [value,time]
:Pause
  • When argument is given, value is some value, be it literal or variable, which Pause will display then pause execution until the enter key is pressed.
    • Pause will display value on the next line, starting from where the cursor initially was located. If the display reaches the seventh line, the display will 'scroll' the rest of the screen up so that the argument can be displayed.
  • If two arguments are given, value is displayed, and the execution waits for time seconds.
  • If no argument is given, the execution waits until the user presses enter.


Ex: Hello

[edit | edit source]
Pause "HELLO WORLD"
* It should be noted that the program execution would pause until enter is pressed.

Ex: Pause

[edit | edit source]
Pause
* It should be noted that the program execution would pause until enter is pressed.

Output

[edit | edit source]

Output, PGRM:I/O:6 allows the display of an argument in a location other than the next line. The item to be displayed is output to the specified coordinates supplied to the function. It is useful for formatted display and it can also be used, if it is the last command of a program, to stop "DONE" from displaying.

Syntax: Output()

[edit | edit source]
:Output(row,col,arg)
  • Where row is a number between 1 and 8 which determines the row location(vertically) arg is to be displayed.
  • Where col is a number between 1 and 16 which determines the column location (horizontially) arg is to be displayed
  • Where arg is the argument to be displayed. This can be a number, string or list.
    • arg is displayed from left to right
    • if arg is too long to fit on one line, the argument will carry over to the next, starting line at row+1,1.
      • if arg continues past the last line of the calculator (row 8), arg only displays the portion that fits into the screen


Ex: Basic

[edit | edit source]
Output(2,3,"HELLO WORLD")

  HELLO WORLD
*HELLO WORLD is moved down one row (making it in the 2nd row) and moved right 2 times (making it in the 3rd column)

Ex: Too Long

[edit | edit source]
PROGRAM:TOOLONG
Output(1,1,"THIS STRING IS TOO LONG")
prgmTOOLONG
THIS STRING IS T
OO LONG


Text()

[edit | edit source]

Text, 2nd:DRAW(PGRM):0 is a command very similar to Output, except that the arguments are displayed on the graph screen rather than on the homescreen which allows a more precise location of text. In addition, Text can accept multiple arguments and will display them one after another. It also allows both the smaller font (by default) and the larger font (if -1 is the first argument) to display the arguments.

Syntax: Text() Small

[edit | edit source]

This form displays the arguments in the calculator's smaller font.

Text(row,col,arg[,arg2][,arg3][,arg4][,…argN]
  • Where row is the vertical displacement of the arguments
    • For monochrome calculators, row is a number between 0 and 61, where 0 is the top of the screen, and 61 is the bottom.
    • For color calculators, row is a number between 0 and 164, where 0 is the top of the screen, and 164 is the bottom.
  • Where col is the horizontal displacement of the arguments
    • For monochrome calculators, col is a number between 0 and 92, where 0 is the very left of the screen, and 92 is the right side of the screen minus one pixel (for the run cursor)
    • For color calculators, col is a number between 0 and 264, where 0 is the far left of the screen, and 264 is the far right.


Syntax: Text() Large

[edit | edit source]

This form displays the arguments in the calculator's larger font.

Text(-1,row,col,arg[,arg2][,arg3][,arg4][,…argN]
  • Where row is the vertical displacement of the arguments
    • row is a number between 0 and 61, where 0 is the top of the screen, and 61 is the bottom
  • Where col the horizontially displacement of the arguments
    • col is a number between 0 and 92, where 0 is the very left of the screen, and 92 is the right side of the screen minus one pixel (for the run cursor)



Previous: Basic Variables
Next: Input
Table of Contents: TI-Basic 84 Programming