philhickling
Programmer
Over the years I have developed a large number of routines, to do common tasks like format a date, strip out spaces, view a file using Wordpad, format and display an error message, etc. I have all these in a few copy libraries, which I include in every program in my applications, and PERFORM them whenever needed. I suspect this isn't the best way, with over 100 sections, and their working storage in every program, whether used or not. I now want to take them out and put them in one place.
What I do works well, and is easy to maintain - but it doesn't seem a good idea to have code copied into hundreds of programs.
What other ways are there of coding and calling these libraries? What is best, and simplest? One program called with procedure pointers to different sections (which I have never used)? One hundred small programs? There must be a better way!
Example of how I do it:
*
**** INIT
PERFORM S50-AUTOMSG.
PERFORM S50-TIME-DIFF-S.
PERFORM S50-DOC-NAME.
PERFORM S99-OPEN-DOC.
/
**** COPYLIBS
COPY "S50.PRO".
........................................................
/
S50-TIME-DIFF-S SECTION.
*************************
*
....
/
S50-DOC-NAME SECTION.
**********************
*
....
etc.
What I do works well, and is easy to maintain - but it doesn't seem a good idea to have code copied into hundreds of programs.
What other ways are there of coding and calling these libraries? What is best, and simplest? One program called with procedure pointers to different sections (which I have never used)? One hundred small programs? There must be a better way!
Example of how I do it:
*
**** INIT
PERFORM S50-AUTOMSG.
PERFORM S50-TIME-DIFF-S.
PERFORM S50-DOC-NAME.
PERFORM S99-OPEN-DOC.
/
**** COPYLIBS
COPY "S50.PRO".
........................................................
/
S50-TIME-DIFF-S SECTION.
*************************
*
....
/
S50-DOC-NAME SECTION.
**********************
*
....
etc.