home *** CD-ROM | disk | FTP | other *** search
- ********************************************************************
- * Program Lister Version 1.00 *
- * by Donald Gloistein, 1986 *
- * Credit for some logic routines: *
- * ListText.C, Don Gloistein, options,etc. *
- * Modify.Pas, Brian Foley, for saving defaults *
- * Qklist.Pas, Unknown, uploaded by two people. *
- * Lister.Pas, Borland International, for the idea *
- * and begining logic. *
- ********************************************************************
- This is the first draft version. Please give me feedback on what would
- be more convenient in the program.
-
- **************************************************************************
- Written by Don Gloistein , 1986
- Telephone: 713-331-9372
- CIS : 76010,474
- Addrress : 2500 Fairway Dr. #922
- Alvin, TX 77511
-
- This program is released to public domain for personal, non-
- commercial use ONLY. You may use it yourself, give it to your
- friends, or distribute it for a cost-based fee as part of a user's
- group or bulletin board service.
-
-
- As this is just a first draft program, it needs more features and
- the ability to do more sophisicated printing. When I have added all
- of that, I feel I will be out of the realm of editing existing work
- and into a new program.
-
- ********** A Unique ShareWare, Money or Help Me Improve the Program *****
-
- If you ask for support or updates of this program, please expect
- to make a donation. This donation is either in the form of money or
- sweat. If you are a programmer like me, you like to improve programs
- and make them more useful. You teach me, that is worth money to me.
- If this program is of use to you please consider a donation of $10.00.
- OR
- Contribute Ideas:
- As the program and source is fleshed out, only the compiled version and
- the instalation programs will be given out. The source code will be
- shared with those who help with suggestions and programming hints.
-
- Compiled on Turbo Pascal ver 3.01A and MS-Dos.
- ***********************************************************************
- NOTE: Some routines may be Dos specific, please check.
-
- These include the opening of the 'PRN' file and the MSDOS specific
- cursor control. These are easy to change. Global change of the
- OutFile to lst will make it print to the printer. However, there
- would be no ability to print to a file. I don't know the way to
- declare it in CP/M, so I hope the change is superficial. I wanted
- to avoid testing each Write statement against the PrintFile variable.
- Otherwise, I am trying to write with the least amount of problems.
- CAUTION: the Modify.Pas procedure (SaveDef.inc) works only for MSDOS
- Turbo 3.01A. The file date and time functions (FDTTM.INC) work with
- MSDOS 3.01A. They use file handles, these could be changed for other
- versions, with little trouble.
- *************************************************************************)
-
- PURPOSE: This Program Lister was designed primarily for Pascal Program
- listing. I needed a way to print documentation easily for placing in
- binders. When I used MicroStar, there were so many include files, I
- also did not want to print each one out. So the include file option
- is in the program. I also wanted to know where procedures were declared
- and written, thus the quick listing option.
- While writing and debugging this program, I was using a lot of paper,
- so I wrote to a file. I left the option in, as I like the speed. I use
- and editor to read the result. When I am rewriting a lot, I like to
- see the changes quickly, but don't need a new set of documentation each
- time.
- I have an office full of program listings. When I am in a major
- project with multiple modules, I get confused which is the latest. So
- each is printed with a banner naming the file printed and the time and
- date it was last updated. I can go through back copies and check what
- is what.
-
-
- BACKGROUND: In Software Tools by Kernighan and Plauger, they mention that
- much is written to support writing other programs. A good tool must be
- easy to master, graceful of mistakes, (some error routines would be useful
- in this program) and make natural assumptions. It should be written for
- general purposes. The original listing program in C language, I have
- been using for two years for programing, Focus Procedure documentation,
- etc. They also show some tools that have complex options, but that
- they don't get in the way of using defaults. I tried to incorporate
- that idea.
-
- A number of programs assume that everyone has an Epson printer,
- like only defaults, etc. I have made all defaults configurable from
- the command line. I don't like to recompile a program each time I
- use it. I was also very tired of getting source code written for some
- other compiler than my own. Thus, if you have MS or PC Dos, the .COM
- file will run as is. No need to have Turbo Pascal.
-
- INSTRUCTIONS : type PROGLIST ? <CR> to see the help menu with defaults.
-
- The program should be fairly self explanitory, Please try it and see
- what it is like. You will get used to it very quickly. All config
- changes can be made by command line commands or program prompts. Thus,
- if you do not have Turbo Pacal 3.01A, but do run MsDos or PcDos, the
- .COM file will run as is. The first thing to do is to run the querry
- command PROGLIST ? <CR> to find out the present defaults. Then
- change them to your taste; e.g.
- PROGLIST /SXQO- <CR>
- This will set the default to Quick Listing and Output to printer then
- prompt you for the name you named the ProgList.Com and the path it
- resides in. After that, unless you change the name or path, you only
- have to use the /S parameter without the X to permanently change the
- defaults. Without the /S, any changes are for that time only!
-
- The command line parser is very forgiving. I wrote it that way because
- I intend to have a version for C Language listings. So the command line
- syntax will accept MSDOS like command options, C or Unix type options:
- PROGLIST filename /O /E+ (MsDos)
- PROGLIST -o -e+ filename (Unix)
- PROGLIST -oe+ filename (joined options)
- PROGLIST /O filename -e+ (Combinations)
- If a logic true is intended the plust [+] can be omitted. It is included
- for completness. There are a couple of exceptions to the jointing.
- If the command is to change a default extension, then it must be the
- last joined option or separately stated.
- PROGLIST /OEDtxt filename (.TXT will be default extension)
- or
- PROGLIST /O /Dtxt /E filename (same result)
-
- NOTE: Full usage is :
- PROGLIST <InputFileName [OutputFileName]> [/options|-options]
-
- All options are processed before action is taken to save if /S or /SX
- is given. There can be only one file name given. If a second filename
- is given, it is assumed that it will be the output file. Thus, you
- do not have to specify /O# if you enter the second name. A default
- extension of .PRN is added if no extension is given.
-
- The help listing can be called at a number of levels,
- PROGLIST ?
- PROGLIST /?
- PROGLIST
- prompt for file name: ?
- I know this is over kill. But I give something for everyone.
- The program is not completely failsafe, I am sure. But it does
- not write to a file if there is one existing. As yet, there is
- no provision for wild cards or path searches. I am not sure
- it is needed. (Any Comments?)
-
-
- PROBLEM: When in quicklisting mode, there is a time that the whole
- * procedure or function line will not be written out. When it is
- written like this:
- * Procedure anyone(var:var1,
- var:var2);
- instead of:
- * Procedure anyone(var:var1,var:var2);
- There is a temporary fix in the GetFirstWord function, it can
- be commented out. It will limit the search to the first number of
- columns as declared by MaxColCheck variable.
-
- I did some short cuts to delete and find characters. These have some
- notes in the source to watch out for endless loops. If you play with
- the source, watch out for them.
-
- FUTURE: Support of dot {.pa} commands for formatting.
- Filling out the basic listing shell to include many features,
- while keeping the basic Software Tool concept intact.
- Installable Printing format strings.
-
- OPTIONS:
-
- This is a quick listing of the details of the extensions. The options
- are self explanatory for the most part.
-
- Options take the form of a designator, a slash '/' or a dash '-' followed
- by the option letter. This is followed by a specifier.
- Boolean (true/false) options:
- Specifier = '-' False
- Specifier = '+' or (none) True
- Number n options:
- Specifier = one to three digits.
- Letter a options:
- Specifier = one to three letters.
- Letter specifiers must be the final joined option or listed
- separately.
-
- /Daaa This changes the default extension for the main file.
- You must use this as the last option in a sequence or
- a separate option. It changes it to the text '.AAA',
- do not put the dot separator in the command. Less than
- three letters will be filled with blanks.
-
- /Caaa This changes the default extension for the include files.
- Same usage and note as for the /D option.
-
- /S This will save the new defaults after they are processed.
- I have always hated to recompile a program or worse, not have
- the source listing and want to change the parameters.
-
- /SX This will save any changed defaults and prompt for the file
- name and path name. This gives you a chance to put the file in
- your \BIN directory for instance and change the name. You can
- have a number of programs configured differently. I use two,
- AList.com to list the entire document
- QList.com to list the headings.
- Both are set up so that I just use a couple of parameters
- to customize the printing.
-
- /Q These options are listed together, they are actually logic
- /A toggles. Only the last one specified is in effect. /A will
- cause the listing to list all lines in main file and if /I
- then in the include file. /Q selects just the procedure and
- function key words to list.
-
- /I This selects listing the include files.
-
- /M This will list all lines in the main file upto the first
- procedure or function. This is useful to include heading
- documentation and globals in the listing, but just quick
- listing the balance of the document.
-
- /Vnnn This sets the vertical tab. It is used at the page top. Use
- it to give yourself white space. I set it to 3 because I use
- top hole file folders.
-
- /Lnnn This sets the number of printed lines per page, NOT the total
- lines. Use this and /V option to format top and bottom white
- space.
-
- /B This places a Banner with the file's date and time of change
- on both top and bottom of the page. If you have had a pile of
- listings on the floor and tried to figure out which was the
- latest, you will appreciate it. The Banner line and following
- space is subracted from the /L option. The banner is considered
- part of the printed lines per page.
-
- /T This selects tab expansion. Some listings I download have tabs
- or some of the documentation has form feeds, this filters all of
- them so that the lister works better. I have tried to make
- allowances for many people's different writing styles and editors.
- This slows the line processing down a little, but is useful.
-
- /Hnnn This used with the /T option to set the size of the tabs. Some
- editors are set up for Pascal (2) or C (3) or (4) or text (8).
- It has no effect if /T- is used.
-
- /Wnnn This sets the printed characters per line (page width). This
- is very useful if you have a printer that prints compressed or
- more than 80 chars per line. (I hate programs that think all
- printers are 10 pitch and 80 chars.)
-
- /Rnnn Use this to pad the right margin with blanks. When the line
- is longer than the page width, the wrapped line will be padded
- also. I leave it to 0 because I punch holes at the top. This
- is best for three ring binders.
-