In many cases, the problem can be avoided by just keeping a copy of B() in the same folder as A(),
and using method 1 above. This approach has these disadvantages:
!
If B() is used my many programs, in many different folders, RAM or archive is wasted with each
copy that is necessary.
!
If changes are made to B(), you need to make sure that all of the copies are updated.
There is no clear solution to this problem. You need to weigh the advantages and disadvantages of
each method. Most programmers use method 2, in spite of its disadvantages.
[7.6] Recursion limits
The 89/92+ support recursion, whichmeans that a function can call itself. Since the operating system
must save the state information of the calling program, there is a limit to the depth to which recursion
can be used. I used this test routine to determine the maximum recursion calling depth:
rectest(k)
func
when(k=0,k,rectest(k-
1
))
endfunc
This program simply calls itself repeatedly, decrementing the k variable, until k = 0.
The program runs correctly for values of k of 41 or less. When k is 42 or greater, the program fails with
a "Memory" error message. This limit does not seem to be sensitive to the amount of RAM and archive
used. I did my testing with a TI-92 Plus, AMS version 2.05.
[7.7] Use return instead of stop in programs for better flexibility, and to avoid a crash
Note: this bug has been fixed in AMS 2.05. stop now works correctly in archived programs
The stop instruction stops program execution. The return instruction, used without an argument, also
effectively stops program execution. It is better to use return instead of stop for two reasons. First, it
makes your programs more flexible. Second, under certain circumstances, stop can cause a crash that
can be fixed only by resetting the calculator.
The improved flexibility comes about if you call one program from another program. For example,
suppose you wrote a program called app1() which does something useful. Later, you decide it would
be helpful to call app1() from another program. If you use stop in app1(), execution stops when app1()
is finished, when you really want to return to the calling application.
Further, using stop instead of return can cause a calculator crash. The effect of this bug is to lock up
the TI92 so that it does not handle keypresses and must be reset. I have only verified this bug on my
TI92 with the Plus module installed, ROM version 1.05.
The bug occurs when an archived program containing the stop instruction is executed with the expr()
instruction. To duplicate the bug, create this program in the \main folder:
stopit()
prgm
7 - 6
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...