Editing Hints
When making changes to GRIP Subroutines (in the subs directory),
be sure to read the "called by" list and verify that any changes
do not "break" any of the calling routines. Adding another choice
to a list is always safe, but changing the parameter list will
require fixing all of the programs that call that routine.
You can "Obsolete" a program if: the functionality of the program is
now part of Unigraphics, it does not provide any useful additions to
this functionality, and there is no "fancy" programming tricks
demonstrated in this program.
If your program uses data files, such as text & part files, for it's
operation, you can use the code demonstrated in ACCESS_DEMO.GRS
to make the program platform-independent. List out this program
for more information.
The following suggestions were originally intended for people
changing UGI programs over to UGII, but applies to any programs
submitted to the Library. Since the Library must fit into a
small space on the Unigraphics Release Tapes, we must make it
as compact as possible while still maintain full functionality.
One way to "shrink" a program is to remove "boxes" of characters
from around comments, blocks of code, etc. An example is shown
below:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ $$
$$ GET MENU OPTION FOR PIPE THREAD TOLERANCE HERE: $$
$$ $$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Reduce it to this:
$$
$$ GET MENU OPTION FOR PIPE THREAD TOLERANCE HERE:
$$
and you will save about 80% of the space the first version used up.
Also, avoid large quantities of "White Space" in a program:
STRING/ editnote ( 200, 132 ) ,$
filespec ( 132 ) ,$
getfile ( 132 ) ,$
hlpfil ( 30 ) ,$
passnm ( 30 ) ,$
entname ( 30 ) ,$
tim ( 5 )
When editted to:
STRING/editnote(200,132),filespec(132),getfile(132),hlpfil(30)
STRING/passnm(30),entname(30),tim(5)
It uses up 110 bytes instead of 310. (A reduction of 64%!) It also
makes editing easier on a screen editor. The "spread-out" statement
takes up 7 screen lines, while the "compressed" statements take up
only 2.
Indentations should be cleaned up, and step over 2 spaces
each loop. Unneeded "$$" can be eliminated. If you feel extra
explanation is needed to document a program, feel free to add
it. Just eliminate the extra characters.
Larger programs should be broken into subroutines. The easiest way
to accomplish this is to mark up a copy of compiler output, marking
off blocks of statements that make up a block of code. Next create
the dimension, CALL/ & PROC/ statements. Use WRITE TEXT to create the
subroutine, and then compile link & test it.
SPECIAL NOTES FOR UGI to UGII EDITING:
Change ARRAYN/ statements to NUMBER/.
Use IFTHEN/, ELSE, ENDIF instead of arithmetic IF's. Get rid of
IF/[Expression],LAB1:,LAB2:,LAB3: statements, especially if they
are difficult to understand.
Add header data using LIBRARIAN.GRS. Use as much data as possible from
the old UGI header, and save the rest after the new header. (No
information should be deleted, since it may have a historical
significance.