home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
file2inc.zip
/
FILE2INC.DOC
< prev
next >
Wrap
Text File
|
1996-06-13
|
3KB
|
73 lines
___________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation for FILE2INC.EXE:
Files included in archive:
~~~~~~~~~~~~~~~~~~~~~~~~~~
FILE2INC.EXE -- Executable
EXAMPLE.PAS -- Turbo Pascal program that demonstrates FILE2INC
EXAMPLE.INC -- INC file created by FILE2INC
FILE_ID.DIZ -- A descriptor
FILE2INC.DOC -- What you're reading now
What is it?
~~~~~~~~~~~
FILE2INC converts any ordinary binary file into a text file which can
be included in any ordinary Turbo Pascal program. A variable can then be
used to access the constant it creates, reading it just like an ordinary
file. In this way, a GIF, ANSI, etc, can be included with a program
without having to access the file when the program is run. This is
impractical, however, with very large files.
Using FILE2INC:
~~~~~~~~~~~~~~~
Simple:
FILE2INC <inputfile> <outputfile>
All extensions should be written down. Example:
FILE2INC test.gif test.inc
Will create the CONST array "test" in the "TEST.INC" file. Another
CONST will be created -- "testsize" which will tell the size of the
array. (The size of the array will be from 0 to the size of the input
file minus one.)
Array must be put into the Turbo Pascal program with the {$I filename}
compiler directive (see EXAMPLE.PAS for usage).
Note: Maximum size of the data segment of a program is 65,520 bytes.
The array, and hence the input file, can not exceed this size. If
the array is too large, Turbo Pascal will give either error #49
"Data segment too large" or error #22 "Structure too large."
Examples:
~~~~~~~~~
Included in the archive are two example files -- EXAMPLE.PAS & EXAMPLE.INC.
When EXAMPLE.PAS is compiled, EXAMPLE.INC will be compiled into it. Keep
in mind that this is a very simple example using only a text file, and
that more complex files, such as GIFs, can be compiled into EXE files
and used in a similar way.
Disclaimer, etc.
~~~~~~~~~~~~~~~~
FILE2INC has lots of error checking built in, but you use this program
at your own risk.
This program was written by Fire Frog in May, 1996. I can be reached
on Internet or at the wonderful BBS listed below. This program is also
freeware, but if you like it or would like to see any changes, write
me at my Internet address or the BBS.
E-Mail address: frog@star2.opsys.com
Or send e-mail to "Fire Frog" on the MANx BBS based in the Miami, Florida
area: 305-245-0113.
___________________________________________________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~