Dec 242017
KS-REF is a Turbo Pascal formatter and cross-referencer. It is user configurable through a menu. It will handle up to Turbo 5.5.
File KS-REF21.ZIP from The Programmer’s Corner in
Category Pascal Source Code
KS-REF is a Turbo Pascal formatter and cross-referencer. It is user configurable through a menu. It will handle up to Turbo 5.5.
File Name File Size Zip Size Zip Type
KS-REF.CFG 66 40 deflated
KS-REF.DOC 10308 3598 deflated
KS-REF.EXE 80064 34863 deflated
KS-REF.FRM 2657 993 deflated
KS-REF.PDF 218 144 deflated
KS-REF.RSV 1086 476 deflated

Download File KS-REF21.ZIP Here

Contents of the KS-REF.DOC file

Version 2.1
Turbo Pascal Formatter & Cross Referencer

Katherine Degerberg

KS-REF reads in a Pascal file, and writes to an output file the
formatted Pascal code and an optional cross reference for the
identifiers within the program. All unit and include files that
are referenced within the program are included in the output code
and cross reference. (Well, all unit and include files whose
source code is in the same directory as their calling program's.)


To install KS-REF simply copy the files KS-REF.EXE, KS-REF.RSV
and KS-REF.PDF (optional) to a directory within your path. The
KS-REF configuration file will be created after the program's
first use. One thing you should be aware of, if you use a lot of
nested include files (15 are allowed in Turbo 5.5) you must have
a FILES=20 (at least 20) in your CONFIG.SYS.


To run KS-REF type KS-REF at the DOS command line. The program
will start with a credit screen (press any key to continue) and
then go into a configuration screen.

You will first be asked the name of the input file. Enter the
name of your source Pascal file. If the name you enter does not
have an extension (or a period) .PAS will be added to the name.
If the file name you supply does not exist, an error message will
appear and you will be reprompted for the file name.

Next you will be asked for an output file name. Enter the name of
the file you want the listing and cross reference put in. If the
name you enter does not have an extension (or a period) .LST will
be added to the name. If you enter the name of a file that
already exists you will be asked if you want to overwrite the
file. Enter Y (overwrite) or N (don't overwrite).

After the names of both the input and output files have been
entered, the options for configuring the output file will be
displayed. As you use the up and down arrows and the Enter/Return
key to cycle through the options, the allowed values for the
current option will be displayed. The left and right arrows allow
you to change the current value of the option. The options are:

Page Format
CPI (10,12,16) The number of characters per inch.

Characters Per Line (40-255) The width of a line.

Lines Per Inch (6,8) The number of lines of text per

Lines Per Page (10-255) The length of a page in lines.

Tab Size (1-10) The number of spaces per tab. The only
tabs that are affected are those internal to a
line (not leading or trailing).

Reserved Words
Note : The file KS-REF.RSV contains all the words KS-
REF considers "reserved". You may edit the file and
delete or add new words. The file does not have to be
alphabetized, and the words may be in upper or lower
case. You may only have a 250 reserved words and each
word may not be longer than 20 characters. The file KS-
REF.RSV initially contains all the standard Pascal 5.5
reserved words plus all standard Pascal procedures and
functions (e.g. Read, Readln, Sin, Sizeof).

Lower Case (Yes,No) Make all reserved words in output
file all lower case characters.

Capitalize (Yes,No) Capitalize all reserved words in
output file (Note : Lower Case and Capitalize are
mutually exclusive. If you ask for both neither
will be done and the words will be kept as they
are in the input file.)

Bold (Yes,No) Boldface all the reserved words,

Underline (Yes,No) Underline all the reserved words.

New Option Printer Model (IBM, Epson FX, HPLaserJet, None, User)
Choose the printer model you are using. If you are
not using one of the listed printers, try IBM or
None, they may work. You may also define your own
printer (see below). Use none if you are not going
to print your listing but just look at it on the

Connect Begin and End's (Yes,No) If this option is
enabled, vertical lines will be drawn from the
start of a code indentation to the end. More than
just begin and ends will be connected,
if/then/elses for, while's and untils will also be

Code Formatting Indentation (1-9) The number of spaces
for each successive code indentation.

Create Cross Reference (Yes,No) Create and include a
cross reference or don't.

New Options -------------------------------------------------------
The following options were included mainly to allow a
file to be simply formatted without adding anything to
the file's text. This allows a source file to be
neatened but stay compilable.

Include Files (Yes,No) Include Include files in listing
and cross reference.

Unit Files (Yes,No) Include Unit files in listing and
cross reference.

Cross Reference (Yes,No) Create or don't create a cross

Line Numbers (Yes,No) Number or don't number lines in
the output file.

Indentation Numbering (Yes,No) Number or don't number
levels of indentation.

Page Breaks & Headers (Yes,No) Include or don't include
form feeds and page headers in the output file.

You may exit out of KS-REF at any point by hitting the Escape
[Esc] key. If you hit [Esc] you will be returned to the DOS
prompt, the current configuration will not be saved.

Once you have configured the output options to the desired state,
hit [End] and the program will start processing. Also, when you
hit [End], the current configuration will be saved to a file

As the program runs, it will display two lines listing the
current file being processed and the current line number (this is
a number global to the entire output listing not the current
file). Once all files have been processed, the message
"Compiling Cross Reference" will be displayed while the cross
reference is added to the listing file. Finally a message
stating "Completed." is displayed. Press any key to return to the
DOS prompt. The program is finished and your listing and cross
reference should be in your output file.

Defining a Printer File

If you have a non-standard printer you may define your own
printer file. A sample printer file KS-REF.PDF is included with
this KS-REF package. The following is an example of what should
be in the file:

Highlight On
Highlight Off

The file may have no blank lines in it. The words can be any
combination of upper and lower case but must be spelled and
spaced exactly as shown. The printer codes can be a combination
of letters or ASCII numbers. Numbers in brackets, <> are
converted to their ASCII value. For example, <27> is an escape.
Check your printer manual for the correct codes. One more note,
the printer id may not be longer than 11 characters.

Asst Notes

One of the printer configurations I've found most useful is to

Characters Per Inch 16
Characters Per Line 132
Lines Per Page 80
Lines Per inch 8

This gives you a highly compressed (but still readable) listing.
It works especially well on the HP Laserjet.

Page breaks within the output file will be every X lines (X being
whatever you designated lines per page to be) and at the
beginning of unit files. You can force a page break to occur
somewhere else (you want a particular procedure to always start
at the beginning of a page) by putting in a {.Page}. Put the
{.Page} at the beginning of a line with nothing else on the line.

KS-REF does not do any sort of Pascal syntax checking so you can
run it against a unit or include file. I have found it useful in
finding missing begins and ends in programs I'm working on.

The program will handle up to a thousand different functions,
procedures, unit files and include files (i.e. # of functions +
# of procedures + # of unit files + # of include files <= 1000).
This number can be increased if users find it limiting.

The way KS-REF indents CASE statements may not be to everyone's
liking. If you find it really irritating (I'm not going to try
to describe what happens) please let me know. If enough people
complain I might fix it.

Please let me know about any problems you have with KS-REF. Even
better, let me know what you would like changed or added. I'm
constantly tinkering with the program so I'd be happy to
incorporate good suggestions.


Version 2.1 August 24, 1990 - A bug was found that caused
KS-REF to bomb out if the source code it was reading had more than
256 procedures and/or functions. This bug was fixed and program
should now work as documented.

 December 24, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>