[7.45] Display Text In Multiple Fonts And Pretty-Print Expressions - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

The times in the table are for one function call, averaged over 500 calls as shown in the examples
above. The test routines ran on a HW2 TI-92 Plus, AMS 2.05. The local routine, archived, is about 3%
faster than the global routine. This is not significant for most applications, but if your program makes
thousands of calls to the subroutine, you may save a few seconds.
Defining the subroutine locally reduces the number of variables in a folder, and makes it a bit easier to
remove the program if needed. If the subprogram has no use outside of its calling routine, there is little
point to defining it globally.
[7.45] Display text in multiple fonts, and Pretty-Print expressions
TI Basic programs are usually limited to displaying text in a single font size. However, E.W. ( author
also of the EQW equation writer) has written a function to display text in 3 font sizes, as well as show
expressions in pretty-print on any display screen. Much of the following description is from E.W.'s
header in the C source code. You can get this function, called write(), from Bhuvanesh Bhatt's web site
at http://tiger.towson.edu/~bbhatt1/ti/. The C source code is included.
The zip file includes versions for both the TI-89 (write.89z) and the TI-92 Plus (write.9xz). Make sure
you use the correct version for your calculator. The examples in this tip show screen shots from the
TI-92 Plus; screen shots from the TI-89 are similar.
write() supports these features:
! Write a line of text in one of three fonts and four modes.
! Write multiple text lines with the different fonts and modes.
! Write a line of text mixed with pretty-printed expressions.
! Write multiple lines of text mixed with pretty-printed expressions.
write() displays the arguments on the current active screen. It will only write inside the screen client
area, that is, it will not write in the toolbar display or the status line area. The active screen may be the
home screen, the Program I/O screen, or the Graph screen. Your program is responsible for displaying
the screen before calling write(). These commands are used to display the different screens:
There are three possible syntaxes for write():
Syntax 1:
write(x, y, string [,font_size] [,mode])
Syntax 2:
write(x, y, {string, string, ...} [,font_size] [,mode])
Syntax 3:
write(x, y, {format_string, "expr",...,format_string,"expr"} [,font_size] [,mode])
Unarchived
Archived
Home screen:
Program I/O screen:
Graph screen:
37.58 mS
37.04 mS
38.02 mS
36.94 mS
DispHome
Disp
DispG
7 - 53

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents