©Convert temp
1
from degrees C to degrees K
temp
1
+273.
1
5
→
temp
1
Some calculations can be efficiently coded as a single large, complex expression. These are the
calculations that really need good explanations. Remember that the purpose of the description is to
describe why you are doing something, not what you are doing - the 'what' is obvious from the code
itself.
Documenting the flow control is easy if the program structure is logical to begin with. goto's and labels
are discouraged in good structured programming, for good reason, but they can result in the most
possible efficient code when used sparingly. It can be challenging to come up with good label names,
so I just have a few common names for pervasive elements such as mainloop and exit. Error handling
may interrupt normal program flow, so the program comments should make it clear where the error is
handled, and where control is transfered after the error is handled.
Where to put the documentation?
There are at least three possiblities for physically locating the program documentation: in the source
code, as a separate readme text file, or as an 89/92+ text file. Putting the documentation in the source
code file has the advantages that the documentation always travels with the program, but it
dramatically increases the code size and uses up valuable on-calculator memory. Programs are most
commonly documented with a separate readme file. This certainly works, but then the user might not
have access to the documentation when they really need it most.
Creating an 89/92+ text file that includes all the program documentation has these advantages:
!
The documentation is on the calculator, with the program, and can be readily accessed. If one user
transfers the program to another user, by calculator, he can also send the text variable, so the new
user has the documentation, too.
!
You can use the special 89/92+ characters in the documentation, which is not easily done in a
separate readme file.
!
You can include sample calls in the text file, which can be executed directly from the file.
!
The user can edit the text file to meet their needs. For example, when they first start using the
program, they may need most of the detailed documentation. As they become more familiar with the
program, they can delete the text they don't need to save memory. Finally, they can add their own
particular comments as needed.
If you use this method, you should give the name of the documentation text variable in the source
code.
[7.33] Local functions must be declared as local variables
You can define programs and functions within a program in TI Basic. This is convenient, in that very
specialized functions are included with the calling program, which simplifies distribution and
maintenance. However, those local functions must be declared as local variables with a
Local
statement. This might seem obvious, and it is in the manual, but I tend to forget it, anyway.
7 - 33
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...