When passing just the function name DOES work:
Sometimes you can pass the function and variable, and it will work. For example, suppose we use the
call
t(f
1
(x),x)
with this program
t(fxx,xx)
Prgm
local xval,result
1
0
→
xval
fxx|xx=xval
→
result
EndPrgm
In this case, the calculator will try to evaluate f1(x) when t() is called. If x is undefined, f1() will be
symbolically evaluated (if possible) with the variable x. This expression is then passed as fxx. Later in
the line fxx|xx=..., the symbolic expression is evaluated. For example, suppose that f1(x) is defined as
f
1
(x)
Func
2*x-3
EndFunc
so, the first evaluation (when t() is called) results in fxx = 2*x-3, which is then correctly evaluated later.
However, if the function performs a conditional test on x, the program will fail. For example, if we have
f
1
(x)
Func
if x>0 then
2*x-3
else
2*x+3
endif
EndFunc
the value of x is not defined at the time of the t(fxx,xx) call, so the program fails with the error message
A test did not resolve to TRUE or FALSE.
(credit for indirection method to Eric Kobrin)
[7.24] Use a script for self-deleting set-up programs
In general, a TI Basic program or function cannot delete itself. However, scripts (text files) can delete
themselves, and this can be used to create a self-deleting set-up process. For example, suppose that
the set-up program is called setup(), and the set-up script is called setscrpt. setscrpt looks like this:
:Press [f2] [5] to run setup
C:setup()
C:Delvar setup()
C:Delvar setscrpt
7 - 23
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...