7.0 TI Basic Programming Tips
[7.1] Create evaluated Y= Editor equations in programs
You can create equations in the 89/92+ by storing the expression to the system variables yn(x), where
'n' is the number of the equation. For example,
a*x^2+b*x+c
→
y
1
(x)
stores the expression to the first equation, y1(x). But if a, b and c have numeric values, those values
will not be substituted in the expression because the expression has not been evaluated. You can
force the evaluation using string() and expr(), like this:
evalyx()
prgm
local a,b,c,ex
4
→
a
3
→
b
2
→
c
a*x^2+b*x+c
→
ex
expr("define y
1
(x)="&string(ex))
Endprgm
evalyx() puts this equation in the Y= Editor:
y
1
=4x
2
+3x+2
This method will work in a program, but not in a function. Since a, b and c were defined before the
expr() function, those values are replaced. Any variables which are not defined will remain variables.
Note that it is not necessary to define the ex variable; this works, too:
expr("define y
1
(x)="&string(a*x^2+b*x+c))
(credit declined)
[7.2] Using the built-in function documentation in CATALOG
AMS 2.03 has a new feature in the CATALOG display in which user-defined programs and functions
can be listed, in addition to the built-in functions. The functions are listed in alphabetical order, along
with the folder they are in. This is very useful.
Even more useful is the fact that you can display a little documentation on the status line of the display.
The status line is the very bottom line of the LCD display. This line will show the first comment in the
program after the Func or Prgm statement. Also, if you press [F1], which is the Help menu tab, a dialog
box opens that shows the same comment, but in a larger font which is much easier to read.
For example, these are the first few lines of a linear regression function:
7 - 1
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...