pid()
→
tmp
if mid(tmp,4,3)="0-0":return
1
.0
if mid(tmp,4,3)="0-
1
":return
1
.0
1
if mid(tmp,4,3)="
1
-3":return
1
.05
return 0
endfunc
Frank also offers these comments on his code:
"In most cases none of this will be necessary. In the rare case that it is, it will probably be more useful
to incorporate fragments into a single function or program making the overall code much smaller.
I claim no rights to any of this code, it is all public domain.
There doesn't appear to be any way to determine hardware version programatically."
(Credit to Frank Westlake and Lars Fredericksen)
[7.15] Avoid For ... EndFor loops
Loops are very slow on the 89/92+. The 89/92+ provide some functions which can be used to
accomplish some operations that are traditionally done with loops:
!
use PolyEval() to evaluate polynomials
!
use seq() to generate a list of function values
!
use sum() to add the elements of a list
!
use sigma
(
Σ
)
to sum the values of an expression
!
use upper-case pi
(‹)
to find the product of expression terms
!
the common arithmetic operators (+, -, *, /, etc) operate on lists & matrices
!
the 'dot operators' (.-, .*, ./, .^) operate on matrices and expressions
!
the submat() function extracts part of a matrix
[7.16] Use when() instead of if...then...else...endif
The 92+ manual describes using when() only to create discontinuous graphs, however, it is much more
useful than that. It can be used in place of the if...endif construction, and is more compact.
when() functions can also be nested to create an if...then...else..endif structure. Suppose you have four
functions f1(x), f2(x), f3(x) and f4(x). You want to evaluate the functions on intervals like this:
f1(x) when x < 1
f2(x) when x>= 1 and x < 2
f3(x) when x>= 2 and x < 3
f4(x) when x >= 3
The If...EndIf version looks like this:
if x <
1
then
f
1
(x)
elseif x
≥1
and x<2 then
f2(x)
7 - 16
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...