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
1
23
→
test
1
\m
1
23
→
test
1
\n
1
23
→
test
1
\t
testtype() gives these results:
testtype("test2\m")
correctly returns "STR"
testtype("test
1
\m")
correctly returns "NUM"
testtype("test
1
\n")
returns "NONE" in error, since
test
1
\n
is a global variable
testtype("test
1
\t")
returns "NONE" in error, since
test
1
\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
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...