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 #330 background imageLoading...
Page #330 background image
Note that the expression is returned in the second history line, above the call to rclexpr().
The copyto_h() function is used to send the result to the history area; see tip [7.8], Copy program
results to home screen. The expression is evaluated in the folder ä, which is an empty folder containing
no variables. rclexpr() creates this folder with newFold() if it does not already exist. newFold() is a
block in a Try ... endTry structure, which prevents errors if folder ä already exists.
rclexpr() is useful in its own right, and the general idea can also be used in your own programs, but not
in functions, because Try ... endTry is not allowed in functions.
[7.41] Indirection bug with local variables
Indirection fails with local variables, both in the Local statement list and when passed as a function or
program argument. This program demonstrates the bug:
testtype(n)
Func
Local t
getType(#n)t
Return t
EndFunc
Note that n is a local variable since it is the argument, and t is declared as a local variable. For these
following initialized variables:
"s"test2\m 123test1\m 123test1\n 123test1\t
testtype() gives these results:
testtype("test2\m") correctly returns "STR"
testtype("test1\m") correctly returns "NUM"
testtype("test1\n") returns "NONE" in error, since
test1\n
is a global variable
testtype("test1\t") returns "NONE" in error, since
test1\t
is a global variable
One work-around is to use special characters for local variable names, for example:
ä, ë, ï, ö, ü, ÿ
,
ä
1,
äë
1, k
ä
With this method, you are assuming that the calculator user will have global variables with these
names. You can combine special characters with conventional characters for program readability, and
to further reduce the chance that the user will have a global variable of the same name. For example,
testtype() can be coded as shown, and returns correct results:
testtype(än)
Func
7 - 41

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