Output

Output is how we get information to the user. We have a nice variety of ways to do this on the TI-89 and TI-92.

A. The IO Screen

Back in section II, we learned how to display information to the IO screen using DISP and OUTPUT. Now that you know something about variables, you should realize that we can display values stored in strings using these functions. We can also display expressions (in pretty print if it is enabled). If you wish to display a combination of strings and expressions on one line, use concatenation (&) as shown in question 4 from the quiz in the last lesson. This is all fairly straightforward.

B. The graph screen

We have a couple of ways of returning information to the user on the graph screen. We can use PXLTEXT and PTTEXT as described in section II. You can use many of the same shortcuts described in the quiz.

Graphics are much more fun. We can use PXLLINE rowstart,colstart,rowend,colend,mode or PTLINExstart,ystart,xend,yend,mode to draw a line. Use PXLCRCL row,col,radius,mode or PRCRCL x,y,radius,mode to draw a circle. PXLHORZ row,mode, PTHORZ y,mode, PXLVERT col,mode, and PTVERT x,mode to draw horizontal and vertical lines. Mode is 1 to turn on the line or circle. Mode is 0 to turn off line or circle. Mode is -1 to invert the line or circle. We can alsouse PXLON row,col, PXLOFF row,col, PTON x,y, PTOFF x,y, PXLCHG row,col or PTCHG x,y to turn pixels on and off. We can check the condition of pixels using PXLTEST(row,col) or PTTEST(row,col) These return 1 if the pixel is on and 0 if the point is off. TIP: I highly recommend using PXL functions to avoid having to set the window If you want to graph a function, you can use Graph expr or define y1(x) as the expression and use FNON 1 to turn y1(x) on (It could also be y2(x)). You could do the same with r1(θ) if you were in polar mode or z1(x,y) if you were in 3D mode.

Unfortunately, generating graphics one pixel or line at a time is not usually useful. It will waste time and space. Instead, we can use picture variables. Use RCLPIC var,row,col to turn on the pixels that are black in the picture variable. RPLCPIC will also turn off pixels which are white. ANDPIC will turn only off pixels which are white in the picture variable. ANDPIC is rarely used. XORPIC will turn off pixels which are already black on the screen and are black in the picture. TIP: XORPIC a solid black picture to inverte the section behind it on the graph screen.

C. Dialogs

Dialog boxes are a much nicer replacement for the IO screen. They have a somewhat more complicated format as well. They are declared with a DIALOG and ended with ENDDLOG. In between, you can have a variety of commands. You can have at most one TITLE string, which must come immediately after the DIALOG statement.
TEXT string displays the string on the next line of the box. REQUEST, DROPDOWN, and OK are used for input and will be explained in section V.

<<Previous - Contents - Next>>