EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Tip List

Texas Instruments TI-89
507 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #357 background imageLoading...
Page #357 background image
EndFunc
st is the string, and ch is the character to count. For example,
charcnt("abcdddef","d") returns 3
(Credit to Mike Grass)
[8.5] string() uses the current number display format
When string() converts a number to a string, it uses the current display format. This behavior is not
explicitly described in the 89/92+ manual. While this is usually what you want to do when using string()
to convert numbers for display, it is usually not what you want if you use string to convert a number for
additional processing.
For example, suppose you want to extract the mantissa of of x, where x = 1.2345678901234E15. If the
current display format is Fix 4, then string(x) returns "1.2346E15". If you use left() and inString() to
extract the mantissa, you will get "1.2346", which is not the actual mantissa. You can retain most of the
precision in x by first setting the format to Float 12, then string(x) returns "1.23456789012E15".
However, note that you have lost the last two significant digits of ...34.
[8.6] Convert strings to upper- and lower-case
The two functions below convert an alphanumeric string to all upper-case or all lower-case characters.
This is useful, for example, to test strings entered by a user in a program.
Upper-case and lower-case character codes differ by 32, but converting the case is not as simple as
adding or subtracting 32, because the string may also include characters which should not be
changed. Only characters with lower-case equivalents are converted. In addition, the character set
includes international characters, so the conversion routines handle those characters as well
The function to convert a string to lower-case:
casel(s)
Func
© (string) convert to lower case
© 7may02/dburkett@infinet.com
local ä,ï,ÿ
""ÿ
for ä,1,dim(s)
ord(mid(s,ä,1))ï
ÿ&char(when(ï65 and ï90 or ï192 and ï214 or ï216 and ï223,ï+32,ï))ÿ
endfor
return ÿ
EndFunc
The function to convert a string to upper-case:
caseu(s)
Func
© (string) convert to upper case
8 - 3

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals