home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
petern.zip
/
PETERN.DOC
< prev
next >
Wrap
Text File
|
1994-06-15
|
4KB
|
123 lines
PeterN c 1994 by Peter Neuendorffer
This is not a program! It is a Turbo Pascal Unit for displaying
text files that you may attach to your Turbo Pascal Program.
This program provides a reader to install in your programs, and allows
you to bundle the text directly onto the .EXE file
Peter N Turbo Pascal 7.0 Text File Tool
To Register, send $15.00 to
Peter Neuendorffer
1399 Commonwealth Ave #11
Allston MA 02134
You need: a. Turbo Pascal 7.0
b. Petern.tpu.
c. The source code to a Turbo Pascal DOS program that does NOT
use attached overlays or drivers.
d. One DOS text (flat) file to display.
e. A little patience to catch on.
To attach a text file for reading:
1. Determine the size of the text file in bytes
(DIR from DOS).
2. Copy the enclosed PETERN.TPU to your .TPU directory.
3. Call up your program source code. At the point you wish to
display a file, insert the procedure display_file() as
described below. THe text file size is most important.
3a Insert PETERN in your uses clause for the current unit.
3b Dos_error will return the runtime error of reading the textfile
(if any).
4. Compile your program
5. exit to DOS,
BEFORE running the program, and AFTER compiling it,
from DOS do this command:
COPY /B FILENAME.EXE + TEXTFILE.DOC
Where filename.exe is the name of your program EXE
textfile.doc is the name of your text file.
6. Run the program.
7. Do not do 5. twice without recompiling the program.
This unit contains 1 procedure, which allows you to display a text
file in page up and page down format. You will be attaching this text
file directly to your program's .exe.
Here is the procedure you get:
---------------------------------------------------------------------
Procedure Display_file(exe_name:string;text_file_size:longint;
cursor_wanted:boolean;page_wanted:boolean;
foreground_color,background_color:byte;
VAR dos_error:INTEGER);
--------------------------------------------------------------------
The parameters for "Display_file" are described below. If you already
are using the name "Display_file" then specify petern.display_file();
Parameters for PeterN UNIT Procedure Display_file();
Your Procedure Parameters (all may be literals, except for dos_error,
which must be a variable)
------------------
exe_name:string
the NAME of your program, for example 'WONDER.EXE'
(this is the name of your .EXE, NOT the name of the text file)
text_file_size:longint
the size in bytes of the text file you wish to display.
If this text file changes, you must change this number
in the source, and recompile, and re-attach the text file
(see above)
cursor_wanted:boolean
If TRUE, then the unit will turn off the cursor during reading,
and turn it back on (bottom scan cursor) on exit.
If FALSE, the state of the cursor will not be touched.
pages_wanted:boolean
If TRUE, page numbers are displayed
if FALSE, page numbers are NOT displayed
foreground_color:byte
The color to display the foreground (will do white if monochrome)
background_color:byte
The color to display the background (will to black if monochrome)
dos_error:INTEGER;
The DOS error_code is returned. (0 if no error)