EasyManuals Logo
Home>Texas Instruments>Calculator>TI-92+

Texas Instruments TI-92+ User Manual

Texas Instruments TI-92+
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 #358 background imageLoading...
Page #358 background image
© 7may02/dburkett@infinet.com
local ä,ï,ÿ
""ÿ
for ä,1,dim(s)
ord(mid(s,ä,1))ï
ÿ&char(when(ï97 and ï122 or ï224 and ï246 or ï248 and ï256,ï-32,ï))ÿ
endfor
return ÿ
EndFunc
Some examples:
caseu("abc")
returns
"ABC"
casel("ABC")
returns
"abc"
caseu("a+b=C")
returns
"A+B=C"
Both functions work by getting the code of each character in the string, with ord(), then adjusting the
code by 32 only if the character has a lower-case equivalent, as determined by its code. Note that the
and operator has higher priority than or, so no parentheses are needed.
The execution time in seconds can be estimated as 0.097c + 0.081, where c is the number of
characters in the string. For example, a 10-character string converts in about 1.05 seconds.
[8.7] Replacement for mid() and right() functions use position instead of count
The built-in mid() function has the syntax mid(string, start [,count]) when used with a string argument.
count characters are returned from string, beginning at character start. Sometimes it is more
convenient to extract characters from a start position to an end position, instead of a number of
characters. It is trivial to find
count = end - start + 1
but it may be useful to define it as a function:
mid1(s,n,m)
Func
©(s,n,m) return elements from n to m of s
©7nov01/dburkett@infinet.com
mid(s,n,m-n+1)
EndFunc
For example,
mid1("abcdefghi",3,7)
returns "cdefg".
The built-in mid() function also operates on lists, and so does mid1(), since it calls mid(). For this
reason, the default behavior of mid1() is the same as mid().
We can also write a similar replacement function for right() which uses a position for the argument,
instead of the number of elements:
right1(s,p)
Func
©(s,p) return right elements from p of s
8 - 4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TI-92+ Specifications

General IconGeneral
BrandTexas Instruments
ModelTI-92+
CategoryCalculator
LanguageEnglish

Related product manuals