home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
BOX1.ARC
/
BOX.DOC
< prev
next >
Wrap
Text File
|
1988-03-06
|
4KB
|
131 lines
Program Name : BOX-PC.COM for MS-DOS (8088, 8086, etc.)
BOX-CPM.COM for CP/M systems (Z-80 req'd)
Source File : BOX.PAS
Compiler : Turbo Pascal V 3.0
Oper. System : CP/M or MS-DOS
Version/date : 1.0 3/19/87
Author : Loring Chien
BOX.COM is a short program I threw together to take a Text file
and create a new file with a Box around the text.
An Example of the output is :
+-----------------------+
| |
| BOXDEMO.TXT |
| |
| This is a demo of the |
| BOX.COM program. |
| |
| Courtesy of |
| Loring Chien |
| 6519 La Mora Drive |
| Houston, Texas 77083 |
| |
+-----------------------+
The input file was:
BOXDEMO.TXT
.LJ
This is a demo of the
BOX.COM program.
.CE
Courtesy of
Loring Chien
6519 La Mora Drive
Houston, Texas 77083
This program was "tossed" together because I felt a need
for an easy method to "box" text - for announcements,
program comment sections, and repetitive print statements
in source code. I find normal text editors fine for
creating the text, but woefully inadequate when putting
the box around it. First you have to pad spaces at the
end of the line, insert the box characters, and center
anything you want centered. When you decide you need to edit
it, you are always fixing up the margins since the editor does
not know how to wrap the box characters. Then you find
that it is too large or too small and you want to change the
size of the box. There is no end of frustration.
With this program all you need to do is edit the text sans
box and submit it to the BOX program. To change things,
just edit the original file, and rerun BOX, at which time
you can change the size and BOX style. BOX will take
care of centering or justification, as requested.
Three commands are accepted, .CE, .RJ, and .LJ. in the
input text. The .CE command causes subsequent lines to
be centered horizontally in the box. This is the default.
The .RJ and .LJ commands cause text to be right justified
or left justified, respectively. Each command is in effect
until another command is given. They may not be used
together, nor does BOX fill or wrap any lines. The
commands must have the dot appear in column one, and
nothing else is allowed in the line.
You will be asked for the input file name, default file
type is ".TXT". You will then be asked if the file is a
Wordstar document-mode file, if so, soft-carriage
returns and spaces will be converted to hard ones and
Soft-hyphens will be removed if not at the end of a line.
You will be asked for a output filename, the default
is the same name as the input file, except with a file-
type of ".BOX".
Options available are for auto-sizing the box (one space
on both ends of the longest line), or specifying a box
of a certain column width.
You also have the choice between a box made of -,|, and +
(line box, type 1), made of asterisks (type 2), made of
IBM-PC graphic lines (types 3 & 4) or a custom box by
specifying all elements (Top, sides, and four corners)
in type 5. You will also be asked if you want to supply
prefix and postfix strings (strings which are appended
to the beginning or end of each line of the box).
Prefix and Postfix strings are very useful. As an example,
consider:
Prefix is Writeln ('
Postfix is ');
then boxed text will be produced which can be inserted into
a Pascal program for screen display.
For BASIC,
Prefix is PRINT "
PostFix is "
to achieve the same thing.
In addition, spaces in a prefix can be used to center
the box, or comment delimiters can be used to make
pretty comments for a program, i.e.
Prefix is /
Postfix is /
can make a box like
/**********/
/* */
/* */
/* */
/**********/
when Asterisks are used for all three characters.
Finally, when the program is done, you can review
the output if you wish; you are asked before the
program exits.
For some really neat-looking stuff, try boxing
text, and then boxing the results to get a double
box.
Future possible enhancements include making it
take input and output file names from the command
line (in which case default sizing and BOX type
will be used).