:Here is an expression
:x^2+2
:"Let's try a string with quotes"
:
General comments:
For the variable name, you can specify a variable in the current folder or you can give the full path. For
TxtWrite(), if the folder you specify does not exist, you will be prompted to create it.
Any input errors (bad argument type, etc.) are shown in the status line.
TxtRead() is a C program, so you will need IPR, as well as h220xtsr if you have a HW2 calculator. See
tip [12.2] for details.
[7.50]
Modify loop control variables within the loop
If you are familiar with other programming languages but not TI Basic, you may not be aware that you
can modify all of the control variables of a For ... EndFor loop, within the loop block. While this is a
dubious practice in terms of code readability and maintenance, it can sometimes result in smaller code.
For example, this loop will never terminate, because the index i never reaches the terminal value n:
1→
n
For i,
1
,n
i+
1→
n
EndFor
You can change the index step size within the loop:
1
0
→
n
1→
step
For i,
1
,n,step
if i=4
2
→
step
EndFor
For this example, i steps through 1, 2, 3, 4, 6, 8, 10.
The example below is a more realistic demonstration. This segment of code processes a list of
expressions e to return a list of the individual terms of the expression. Initially, list e has only one
element, but it grows as terms are separated, and shrinks as they are removed to the output list o.
while dim(e)
≠
0
for i,
1
,dim(e)
© Process each element of 'e'
e[i]
→
ex
part(ex)
→
px
augment(left(e,i-
1
),right(e,dim(e)-i))
→
e
© 'e' reduced by one element
if px=0 or px=
1
then
augment(o,{ex})
→
o
elseif px=2 then
part(ex,0)
→
px0
if px0="+" then
augment(e,{part(ex,
1
),part(ex,2)})
→
e
© 'e' increased by two elements here ...
elseif px0="-" then
augment(e,{part(ex,
1
),
⁻
part(ex,2)})
→
e
© ... and here
7 - 64
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...