Making Programs Readable - HP 9000 200 Series Manual

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

This command would do nothing except generate an error:
DEL 250,10
If you have subprograms or user-defined functions in your program, they can only
be deleted in certain ways (such as with DELSUB). Primarily, the SUB or DEF
FN statement cannot be deleted without deleting the entire subprogram or function.
This subject is explained fully in the "Subprograms" chapter of BASIC Programming
Techniques.
The DEL command is not programmable and cannot be used while a program is running.
Making Programs Readable
When first learning how to program, most people view the use of comments, long variable
names, descriptive printouts, and other documentation tools as merely extra typing
that isn't really necessary in their short programs. As time passes, old programs are
expanded, new programs are written, and more people use the program. Eventually,
software support activities become necessary. Some obscure bug is found or some exciting
enhancement is requested. The programmer picks up a copy of a program written a year
ago and can't begin to remember what "Xl" was or why you would ever want to divide
it by "X2". Program documentation can make the difference between a supportable
tool that adapts to the needs of the users and a support nightmare that never really
does exactly what the current user wants. Keep in mind that the local software support
person just might be you.
This BASIC language makes it easy to write self-documenting programs. In addition to
BASIC's standard REM (remark) statement, additional documentation features are:
• Descriptive keywords (such as REPEAT .. UNTIL, LOOP .. END LOOP, and so forth)
• Descriptive variable names (up to 15 characters)
• Descriptive line labels (up to 15 characters)
• End-of-line comments.
Editing and Storing Programs
6-27

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents