Dec 302017
 
Compress nearly any kind of file into a running .com file. Outstanding program.
File SCRUNCH1.ZIP from The Programmer’s Corner in
Category Utilities for DOS and Windows Machines
Compress nearly any kind of file into a running .com file. Outstanding program.
File Name File Size Zip Size Zip Type
PRTPARM.COM 54 54 stored
SCRUNCH.LST 1638 732 deflated
SCRUNCH1.COM 8081 7767 deflated
SCRUNCH1.DOC 43925 12361 deflated
SCRXR.BIN 757 630 deflated
SCRXR.STB 418 409 deflated
SCRXR.TXT 339 232 deflated
SCRXW.BIN 1798 1289 deflated
SCRXW.STB 1276 968 deflated
SCRXW.TXT 522 326 deflated
TESTR.BAT 483 269 deflated
TESTW.BAT 600 313 deflated

Download File SCRUNCH1.ZIP Here

Contents of the SCRUNCH1.DOC file



SCRNCH (TM), A Data Compressor
Copyright (C) 1987, 1988
Graeme W. McRae
P.O. Box 16
Monmouth Jct. N.J. 08852
1-201/329-3786 (ans. machine)
Version 1.0 Jan 31, 1988

SYSTEM REQUIREMENTS

At least 140K of available memory

76K plus the SCRNCHed file size, and at least 140K, is
required on the user's system that will deSCRNCH files.

HOW TO RUN SCRNCH

The simplest way to use SCRNCH is: SCRNCH inputfile outputfile

where inputfile and outputfile are the complete filenames.

SCRNCH doesn't make any assumptions about directories or
filename extensions. The outputfile must have a .COM
extension, or you'll get an error message. (Sometimes an
.EXE extension is allowed as well.) The outputfile created
by SCRNCH will be an executable program that will either
type out the inputfile, or if the inputfile is a .COM
program, run the program.

There are options that you can specify on the command line
to make SCRNCH run faster, or produce even more compact
output. You can use the /s option to make it run slower (to
get better compression) or /f to make it run faster than
normal. SCRNCH runs roughly 10 times as long using /s
compared to /f, and the compression improvement is usually
10% to 20% (comparing the sizes of the output files). The
default speed lies somewhere in between. There are also
ways to customize the output created by SCRNCH.

THE TWO MODES OF SCRNCH: WRITE AND RUN

A SCRNCHed program reconstructs the original input file when
it is run. The reconstructed data can be placed either on
the disk or in the PC's memory. You make the choice when
you SCRNCH the data.

WRITE MODE

Write Mode is the usual way SCRNCH is used. In Write Mode,
SCRNCH produces an output program that reconstructs the
original data. It can be used for absolutely any input
file. Your user will run this SCRNCHed program once to
install your software or data file. Unless you use an exit
routine, the deSCRNCHed file will be written to "standard
output", which can be redirected to a disk file by the user
using the ">" symbol.

RUN MODE

Run Mode is used only to compress executable programs in the
form of .COM files. In Run Mode, SCRNCH produces an output
program that reconstructs the original program in memory,
and then begins executing that program. Your user will run
this type of SCRNCHed program every time he uses your
product. The program will deSCRNCH itself each and every
time it is used.

If your file to be compressed contains repeated strings,
such as a word that appears hundreds of times in the file,
or lots of white space, compression will be better than a
file with less repetition. You can take advantage of this
fact when you design the file in the first place.

RUN MODE .COM FILE SIZE

Now here's where SCRNCH comes in: A SCRNCHed .COM file can
be much smaller than the original, so an illegally huge .COM
file could be SCRNCHed down to a legal size, so it can be
loaded by DOS.

Usually, large programs are compiled as .EXE files, which
have no 64K size restriction, but they aren't SCRNCHable in
Run Mode. To get the benefit of SCRNCHing, a program must
be created in the form of a .COM file. What kind of .COM
file exceeds 64768 bytes? Most compilers won't create a
.COM program this large. If you are very clever, you can
compile a large program as two or more separate .COM files
that you concatenate using the DOS COPY command.

EXIT ROUTINES

An exit routine is a program that is included with the
SCRNCHed output program, and called while the program is
deSCRNCHing itself. An exit routine can be used to provide
information and instructions to your user. The exit routine
is called once before deSCRNCHing (pre-exit), once before
each write to the disk (status-exit), and once after
deSCRNCHing is complete (post-exit). The exit routine is
also called if a disk error occurs (error-exit). These exit
routines should be small, because they're included along
with the SCRNCHed output. But they should also provide
maximum assistance to the user. See below.

The exit routines used with Write Mode and Run Mode are
quite different from one another because of the basic
difference between the two modes. In Write Mode, the exit
must be concerned with telling the user that it will create
a file, asking for a filename, opening a file, processing
errors, etc. In Run Mode, a program is deSCRNCHed directly
into memory. The exit must tell the user what the program
will do, and give the user an opportunity to run the program
after it is deSCRNCHed.

Another very special ability of the Run Mode exit is to
preserve the self-customizing ability of your program. Your
programs may have a companion "setup" programs that allows
your user to set permanent options that will always be in
effect when your program is run. The setup program often
works by updating the main program directly. If the main
program is SCRNCHed, the setup program will no longer be
able to find the right data to update, unless you make use
of the Run Mode exit routine. The exit routine is not
SCRNCHed, so its data is in "plain view" to the setup
program. The post-exit gets control after deSCRNCHing, so
any data placed there by the setup program can be used by
the exit to modify your program.

Two sample exit routines are provided for you. One is used
for Write Mode, and the other for Run Mode. In Write Mode,
the sample exit routine holds the user's hand. The pre-exit
asks the user for a filename before deSCRNCHing begins, then
the status-exit provides a status report showing how many
bytes have been written when called before each write to the
disk. Lastly, the post-exit moves the cursor to the bottom
of the screen after deSCRNCHing is complete. If an error
occurs, the error-exit routine erases the bad file, and
tells the user what kind of error occurred.

If the user invokes your SCRNCHed program with the parameter
stdout, the file will be written to standard output, but no
status or error messages will be displayed. This is useful
if you want your user to redirect the deSCRNCHed output to a
file using the ">" symbol. If you provide an INSTALL.BAT
file, you can make use of this fact to completely deSCRNCH
all the files in your package, while still permitting the
user to deSCRNCH individual files with complete hand-
holding.

The sample Run Mode exit displays a screenful of information
in the pre-exit if the SCRNCHed program is called with no
parameters. The user then has the opportunity to continue
or abort execution. The Run Mode post-exit then either
continues or aborts execution. Later, under the heading
Customizing SCRNCH Output, you will find out how to
customize these exit routines to your product.

SCRNCH SYNTAX

SCRNCH

[/r | /w]

[/f | /s]

[/o]

[/e[:exitname]]

inputfile

outputfile

The meanings of the parameters are:

/r Run Mode output will be generated

/w Write Mode output will be generated.
Run and Write Mode are mutually
exclusive. If neither is specified, the
default is Run Mode if the inputfile is
a .COM file, or Write Mode otherwise.

/f Fast. SCRNCH will run faster than
normal. The degree of compression will
be reduced.

/s Slow. SCRNCH will run even slower than
normal. The degree of compression will
be the best possible. Fast and Slow are
mutually exclusive. The default is
Medium if neither is specified.

/o Overwrite. If /o is specified, SCRNCH
will overwrite an existing output file
without prompting the user.

/e[:exitname] Exit routine. The file, exitname, is
included with the SCRNCHed output file,
and is called by the deSCRNCHer. If
exitname is omitted, the default is
SCRXW.BIN in Write Mode, or SCRXR.BIN in
Run Mode.

inputfile The file to be SCRNCHed. The full
drive, path and filename must be given.

outputfile The file into which the SCRNCHed output
will be written. The outputfile must
end in .COM or .EXE, although .EXE is
only permitted in Write Mode. If you
are SCRNCHing a file larger than 64k
bytes, you should use an outputfile
ending in .EXE.

Example 1

C> scrnch /f /w samp.doc sampdoc.com
Input file: samp.doc
Output file: sampdoc.com
Options in effect: Fast, Write.
Pass 1: Counting bytes.
Pass 2: Trial SCRNCH: 566 of 566 bytes processed.
Pass 3: Final SCRNCH: 566 of 566 bytes processed.

In example 1, we SCRNCH a file called samp.doc, producing
the SCRNCHed program, sampdoc.com, which when executed will
recreate a copy of samp.doc. The /f and /w parameters tell
SCRNCH to go fast, and to use Write Mode. The first three
lines below the command are confirmation messages produced
by SCRNCH so that you know what it thinks you told it to do.
If you change your mind, you can abort the run by pressing
Ctrl-Break. The "Pass 1, 2, and 3" messages give progress
reports to assure you that everything is still working.

Example 2

C> scrnch /fw samp.doc sampdoc.com
Options in effect: Fast, Write.

Output file sampdoc.com exists.
OK to overwrite (y/n)? y

Example 2 has the same options as example 1, except we've
run them together following a single slash. The same three
confirmation messages are given, but this time you are asked
to confirm that you want to overwrite the file sampdoc.com,
which had been created in example 1.

Example 3

C> scrnch /e samp.doc sampdoc2.com
Exit file: scrxw.bin
Options in effect: Normal speed, Write.

Example 3 illustrates the use of an exit routine. We've let
the speed default to normal. The mode defaults to Write
Mode because the input filename does not end in .COM. The
name of the exit routine defaults to scrxw.bin, because
Write Mode is being used. If Run Mode were in effect, the
exit filename would default to scrxr.bin. If an exit is
being used, the name of the exit file is always displayed on
the screen for your information.

Example 4

C> scrnch /e:sampdoc.bin samp.doc \newdir\sampdoc.com
Exit file: sampdoc.bin
Options in effect: Normal speed, Write.

Example 4 illustrates how to specify a specific exit routine
file name. It also shows how a full path name can be given.
Any of the three filenames can be given as a full path name.

CUSTOMIZING SCRNCH OUTPUT

To customize SCRNCH output, you must use an exit routine.
The exit routine is included as part of the program created
by SCRNCH, and is called when the user deSCRNCHes your
product. If you use the default exit routine, the user will
see a bland message that says very little of interest -- it
doesn't even mention the name of your product.

Customizing SCRNCH output means showing your user right away
some of the good things your product has to offer. There
are two ways to customize. The easy way requires no
programming. You just create a text file in a certain
format, and follow the simple procedure below. That text
file is displayed to the user in a nicely formatted screen
with a tidy border. The hard way requires that you write an
assembly-language program. The advantage of doing it the
hard way is that your exit can do anything at all. It can
present an animated illustration of your product, for
example.


USING SCRNCH WITHOUT EXITS


You may have some very good reasons to not use exits to
customize SCRNCH output. For one thing, exits take up room,
especially since the exit code itself is not SCRNCHed. For
another, customization may not be worth the extra work you
must put in.

If you are using Run Mode, the result of SCRNCHing is a
program that works exactly like the original program, except
that any exits will be run before the program begins. So if
you are using Run Mode, you may not wish to have exits that
change the operation of the program.


MODIFYING THE SAMPLE EXITS


Modifying the sample exits is the easiest way to customize
SCRNCH output. It's the way I used when I SCRNCHed the
documentation file that describes SCRNCH itself. The
procedure works like this: Using a text editor, modify the
sample text file to describe your product, and to give the
user something to look at while he's deSCRNCHing it. Save
the modified text file under a different name. Then, using
the DOS COPY command, append the text file to the exit
"stub" file, forming a new exit file. Now, in more detail,
here's how to do it.

Modifying the Write Mode Sample Exit

By their nature, the exit routines for Write Mode and Run
Mode are different from one another. You should be familiar
with the operation of deSCRNCHing from the user's point of
view before you begin customizing your own deSCRNCHer. If
you aren't familiar with it, you should read the section
Exit Routines, that describes the user exits. You should
also execute SCRDOC.COM, which takes you through the
deSCRNCHing of the document you are now reading.

This is how to modify the Write Mode Sample Exit. Using
your text editor, pull in the original copy of the Write
Mode exit text, SCRXW.TXT. It will look something like
this:

001 1510
002 2300
003 1114sample.txt
004 0218We are about to create a documentation file
005 0318that describes this software package. You
006 0418may press to accept the default
007 0518filename, or you may override the default by
008 0618typing in another filename. Or you may
009 0718press to exit without creating
010 0818a file.
011 1105Default:
012 1204Override:
013 1214
014 1818The documentation file has been created.
015 1918Please take the time to read it thoroughly.
016 2018Thank you for using this product.
017 2300

Then save this file as NEWEXIT.TXT, for example. The
numbers on the left are line numbers, provided for reference
only. The text to the right is from the file, scrxw.txt,
and consists of a screen-row and screen-column number,
followed by the text to be displayed at that location. The
row and column are relative to zero. That is to say, the
upper left corner is 0000.

In addition to providing text to be displayed on the screen,
some of the lines have special meaning to the exit routine.
The first line (line 001) gives the location at which any
error messages will be displayed. Error messages can be up
to 64 characters in length, and the screen contains a
border, so this field must begin no later than column 14.
The second line gives the location for the cursor during
deSCRNCHing. It is placed on line 23 so that if any DOS
messages are generated, they won't interfere with the layout
of the screen. The third line gives the default output
filename. This filename will be adorned with the default
drive and directory name before the user sees it, so it may
be a fairly long field. So it shouldn't begin any later
than column 14. Starting with the fourth line, all text is
displayed on the screen as-is, and has no special meaning
until the first blank line is encountered. The cursor is
left there for the user to type or press ENTER. Then, after
deSCRNCHing is complete, the remaining lines are displayed
on the screen.

Now, to finish the process, issue the following DOS command:

COPY SCRXW.STB + NEWEXIT.TXT NEWEXIT.BIN

Then, to use the exit in SCRNCH, issue a command of the
form:

SCRNCH /E:NEWEXIT:BIN inputfile outputfile

Modifying the Run Mode Sample Exit

The Run Mode Exit is different from the Write Mode Exit,
since it is invoked by a program that will deSCRNCH itself
then begin executing, not a program that will deSCRNCH
itself then write a data file. You should be familiar with
the operation of Run Mode deSCRNCHing from the user's point
of view before you begin customizing your own deSCRNCHer.
If you aren't familiar with it, you should read the section
Exit Routines, that describes the user exits. You should
also execute SCRNCH.COM, which is itself SCRNCHed. It takes
you through the deSCRNCHing and execution of the SCRNCH
program. The first screen, with text inside a large square
border, is produced by the Run Mode Exit.

This is how to modify the Run Mode Sample Exit. Using your
text editor, pull in the original copy of the Run Mode exit
text, SCRXR.TXT. It will look something like this:

001 1214
002 2300
003 0318This is an introduction to the program you
004 0418are about to run. You should enjoy reading
005 0518this message so much that you do not even
006 0618notice the time it takes to de-compress the
007 0718program! Please press to begin, or
008 0818 to quit.
009 1018
010 1518This program was ended by the key.
011 2300

As in the Write Mode example, the numbers on the left are
line numbers, provided for reference only, and the text,
shown next to the line numbers consists of a screen-row and
screen-column number, followed by the text to be displayed
at that location. The row and column are relative to zero.

In addition to providing text to be displayed on the screen,
some of the lines have special meaning to the exit routine.
The first line (line 001) gives the location at which any
error messages will be displayed. Error messages can be up
to 64 characters in length, and the screen contains a
border, so this field must begin no later than column 14.
The second line gives the location for the cursor during
deSCRNCHing. It is placed on line 23 so the user doesn't
think input is expected. Starting with the third line, all
text is displayed on the screen as-is, and has no special
meaning until the first blank line is encountered. The
cursor is left there at the end of the pre-exit, then
deSCRNCHing begins. After deSCRNCHing is complete, the
post-exit waits for the Enter or Esc key to be pressed. If
the Enter key is pressed, the deSCRNCHed program begins
executing immediately. If the Esc key is pressed, the
remaining lines are displayed on the screen.

Now, to finish the process, issue the following DOS command:

COPY SCRXR.STB + NEWEXIT.TXT NEWEXIT.BIN

Then, to use the exit in SCRNCH, issue a command of the
form:

SCRNCH /E:NEWEXIT:BIN inputfile outputfile


HOW TO WRITE SCRNCH EXITS


You should read this section if you are an experienced (or
adventurous) assembly-language programmer. It provides the
technical details you will require to write a SCRNCH exit
routine. In addition to the normal requirements of assembly
language programming, SCRNCH imposes additional
restrictions. This section covers those restrictions, and
describes the techniques you must use to write your SCRNCH
exit routine.

The exit is really four exits, the pre-exit, post-exit,
status-exit, and error-exit. The status- and error-exit is
necessary only in Write Mode. The pre- and post-exit is
necessary in both Write and Run Mode. These four exits
share a common entry point. When the exit routine is
called, the AX register contains a code that tells it the
reason it was called.

This exit should be assembled using MASM or an equivalent
assembler, then LINKed and EXE2BINed. The output of EXE2BIN
is used as the exit routine supplied to SCRNCH. When
SCRNCHing, supply the name of the exit routine with the
parameter /e:exitname.bin. Note that this exit routine may
not be executed at the DOS prompt, because its calling
sequence is non-standard. It is far-called by the
decompressor portion of the output of SCRNCH. The origin of
the exit routine is 100h, or in other words, the IP register
is set to 100h by the far call, and CS is adjusted
accordingly. The parameters passed to the exit are given
below. The exit routine may use up to 1024 bytes of the
stack for its own purposes. It may use data in its own code
segment, and rely on that data from one call to the next.
If the exit is called to decompress an executable program
(Run Mode), then ES points to the program's PSP during both
the pre-exit and the post-exit (This permits you to
implement self-customizing programs in which the post-exit
updates the in-memory copy of the program after deSCRNCHing
but before execution begins). Other than these specific
rights, the exit routine has no right to access memory. In
particular, it may not use DOS memory management functions,
it may not assume it owns memory outside of the program
itself, and it must restore all registers except those
specifically permitted, below, as "output registers".

Write Mode Exit Routine Parameters

Pre-exit

When called: Once, before deSCRNCHing begins.

Input Registers: AX = 1
DS = Program's PSP segment
BX:CX = Size of output file to be
created

Output Registers: AX = handle of opened output file or
zero to abort with errorlevel 8

Note 1: This routine must either open an output
file or return a pre-opened handle such
as 1 for standard output (or zero to
abort).

Note 2: The output file size can be displayed by
the exit perhaps to help the user decide
what drive to use, or whether to abort.
(The sample exit doesn't do this,
however.)

Note 3: Although it is possible to return to DOS
using function 4Ch, it is preferred that
you abort by setting AX to zero, then
far-returning. In this case, the Error
exit will not be called.

Note 4: The pre-exit is the only exit that has
addressability to the PSP. This is
important if you need to see the command
line parameters.

Post-exit

When called: Once, after successful deSCRNCHing is
complete.

Input Registers: AX = 2

Output Registers: (none)

Note 1: The default exit routine takes this
opportunity to write a "done" message to
the screen, and thank the user for using
this product.

Note 2: It is not necessary to close the output
file.

Note 3: If you display a running total of bytes
written (see Status-exit Note 2, below)
then you should display the final total
from this post-exit.

Status-exit

When called: Once before every write to the output
file.

Input Registers: AX = 3
CX = number of bytes to be written this
time

Output Registers: AX = 0 to abort, or non-zero to continue

Note 1: The default exit routine uses this to
keep a running count of bytes written.
This has the effect of reducing the
user's anxiety while de-SCRNCHing.

Note 2: This routine is called before writing,
not after. So it is good form to
display the running total before adding
CX to it. Leave the running total in
CS-addressable storage for the next run
through.

Error exit routine

When called: Only if an error occurs writing the
output file. A message describing the
error is passed to the exit routine.

Input Registers: AX = 4
CX = number of bytes in error message
DS:DX = far pointer to error message

Output Registers: AX = 0 to end without printing error
message, or else AX non-zero to print
error message.

Note 1: The exit routine should clean up by
deleting the output file.

Note 2: It is not necessary for the exit routine
to display the error message, since it
will be automatically displayed as soon
as the exit routine returns. However,
you may wish to code your exit routine
to display the error message, then
return with AX zero to tell the
deSCRNCHer not to print it again.

Run Mode Exit Routine Parameters

Pre-exit

When called: Once, before deSCRNCHing.

Input Registers: AX = 1
ES = Program's PSP segment

Output Registers: AX = 1 to continue, or zero to abort
with errorlevel 8

Note 1: Although you could abort here, it is
better to wait until the post-exit.
That way, the program can be busy de-
compressing itself while the user
decides whether to abort.

Post-exit

When called: Once, after deSCRNCHing but before
beginning execution of the deSCRNCHed
program.

Input Registers: AX = 2
ES = Program's PSP segment

Output Registers: AX = 1 to continue, or zero to abort
with errorlevel 8

Note 1: The normal end of de-SCRNCHing is only
the beginning of program execution.
This default exit routine takes this
opportunity to decide whether to begin
execution, or instead to abort.


ERROR MESSAGES


Error messages are issued in two places: by SCRNCH, when you
compress a file, and by the SCRNCHed file, when the user
tries to use it. So this list of error messages is divided
into two parts.


ERROR MESSAGES ISSUED BY SCRNCH


Syntax error. Type SCRNCH (with no operands) at the
DOS prompt for more info.

ERROR: Unknown option "x".

These messages mean SCRNCH couldn't understand the
parameters you typed at the command line. If you just type
SCRNCH by itself at the DOS prompt, some help will be
displayed on your screen. The square brackets [ ] denote
optional parameters. A common mistake is forgetting the
blank between options. For example, if you use /r/f to get
both Run Mode and Fast, the second slash will be interpreted
by SCRNCH as a subparameter of Run Mode, and you'll see
ERROR: Unknown option "/". To fix this, use /r /f to get
both Run Mode and Fast.

ERROR: Input file not found.

ERROR: Input file access denied.

ERROR: Input file path not found.

ERROR: Failure to open input file.

These messages are issued by SCRNCH when it can't open
inputfile. The first three try to give a clue as to the
reason. The last messages is issued if the reason can't be
determined. Usually this means you've misspelled the name
of the file or you've forgotten to supply the correct path
name or extension. Remember, unless the file is in the
current directory, you must specify the full path name.

ERROR: Input file is null.

SCRNCH doesn't know what to do with a file of zero length.
This message might be caused by using one of the DOS
reserved names as inputfile. For example, if you try to use
CON as the inputfile, this message will be produced.

ERROR: Output file access denied.

ERROR: Output file path not found.

ERROR: Failure to open output file.

These messages are issued by SCRNCH when it can't open
outputfile. "Access denied" commonly means you've tried to
write to a directory name or to a file that is marked "read-
only". The other messages are usually caused by misspelling
the output file name.

Output file xxxxx exists... OK to overwrite (y/n)?

This message is issued to give you one last chance to bail
out. The file xxxxx will be wiped out if you reply y to
this message. SCRNCH ends if you reply n. If the /o option
had been specified, this message would not have been issued.

ERROR trying to write to output file.

Something prevented successful writing to the output file.
Usually, this is caused by filling up the disk. When you
get this message, use DIR to see if the output disk is full.
If not, use the COPY command to write to the disk to see
what the trouble is. Be aware that a partially created file
may be on the disk, and that it should not be used.

ERROR: Exit file not found.

ERROR: Exit file access denied.

ERROR: Exit file path not found.

ERROR: Failure to open exit file.

These messages are issued when the exit file (given by the
/e option) can't be opened.

Memory allocation failed.

ERROR: Insufficient available memory.

These messages are issued when SCRNCH tries to acquire an
area of storage using the DOS memory management functions,
and those functions fail. If you see such a message, try
the following steps: Reboot, and try again. Boot from the
DOS distribution diskette, and try again. Remove
"suspicious" devices from CONFIG.SYS and suspicious TSR's
from AUTOEXEC.BAT, and try again. Make sure your machine
has sufficient free memory. Use CHKDSK, and compare your
available memory to the "System Requirements" given near the
beginning of this manual.

Warning: if more memory were available, SCRNCH would
run faster.

This message is issued when you have enough memory to run
SCRNCH, but not enough for SCRNCH to acquire an extra 128K
buffer used to improve execution speed. Tests have shown
that without this buffer, SCRNCHing takes about 20% longer.

INTERNAL ERROR nn

ERROR: DOS Function failed.

One of these messages will be issued by SCRNCH when
something "impossible" happens. The messages were placed in
the SCRNCH program during development to aid in debugging.
It is very unlikely that one of these messages would be
issued, but if such a message pops up, I'll need to recreate
the problem and fix the SCRNCH program, and then mail you a
new copy.

Break! You are less than half-way finished. Do you
want to end (y/n)?

Break! You are almost finished. Do you really want to
end (y/n)?

SCRNCH terminated by Break!

These messages are issued when you press the Break key, or
Ctrl-C. One of the first two messages is displayed,
depending on whether SCRNCH is less or more than half-way
finished. If you reply n to the question, SCRNCH continues
normally. If you reply y to the question, the last message
is issued, and SCRNCH ends.

ERROR: Output file must have .COM extension.

If Run Mode is specified, the output file must have a .COM
extension. If it doesn't, this message is issued.

ERROR: Output file must have .COM or .EXE extension.

If Write Mode is specified, the output file must have a .COM
or .EXE extension. If it doesn't, this message is issued.

ERROR: /r was specified, but input file is not a .COM
file.

This message is issued if you used the /r parameter to force
Run Mode, but the input file does not have a .COM extension.
If the input file is really executable, rename it.

Warning: input file does not have standard header
format for an .EXE file.

This message is issued if the input file has an .EXE
extension, but does not contain valid .EXE header
information. This is only a warning, so SCRNCH continues.
But you might want to think about it and perhaps Break out
of SCRNCH to find out why this happened.

Warning: input file has an .EXE header even though its
name ends in .COM.

ERROR: input file has an .EXE header, so it can not be
processed as a .COM file.

This message is issued if the input file is really an .EXE
file masquerading as a .COM file. It is a little-known fact
that any .EXE file can be renamed to have a .COM extension
and still work perfectly under DOS. SCRNCH, however, cannot
handle such files in Run Mode. This message will alert you
to the fact. In Write Mode, the message is just a warning,
because the outputfile will be usable. But in Run Mode, the
message is an ERROR, and terminates SCRNCH because the
outputfile will be unusable.


ERROR MESSAGES ISSUED BY THE DESCRNCHER


It is recommended that you include a READ.ME file or printed
instructions for your user that describe how to deSCRNCH the
files. You should include explanations of the following
messages the user might see. These messages could also be
issued by SCRNCH, since SCRNCH is itself SCRNCHed.

Out of memory.

This message means that there isn't enough memory to
deSCRNCH the file. Your user should try rebooting, perhaps
from the DOS distribution diskette, and then try to deSCRNCH
again.

Bad copy.

This message means that an error occurred during the
transmission or copying of this SCRNCHed program. Your user
must obtain a new copy of the program, and try again.
Partially written data, if any, is erased.

Error writing.

This message means the file can't be created because DOS is
not able to write to the output file. Any partially written
data is erased.

Disk full.

This message means there isn't enough room to write the
output file. If you are writing to a diskette, make sure it
is formatted correctly, and there aren't too many extra
files on it. If your user formats a diskette using the /s
parameter, the user may not have sufficient room, so it
should be reformatted without the /s parameter.


QUESTION AND ANSWER


USING SCRNCH WITH ARC


Q: I already use ARC. Why do I need SCRNCH?

SCRNCH provides a different kind of service from ARC. It
allows you to include a message to the user along with the
program or data file. It allows your user to decompress the
file without any special program at his end. SCRNCH can be
used to lend a more professional look and feel to your
product.

Q: Can I look at a SCRNCHed text file without going to the
trouble of deSCRNCHing it first?

A: Vern Buerg's LIST program can help you view SCRNCHed
documents very easily. If the file was SCRNCHed with no
exit routine, or with a customized sample exit routine, the
deSCRNCHed output can be piped into LIST. Using SCRDOC.COM
as an example, here's how it is done:

scrdoc stdout |list /s

If you keep the SCRNCHed documents on your disk, you can
always look at them this way without ever creating a
deSCRNCHed copy on the disk.

USING SCRNCH WITH XEQ

Q: I understand SCRNCH is more effective on larger program
files than smaller ones. How can I compress small programs?

A: You can gather small program files together using a
program called XEQ.COM. Many individual commands in the
form of small .COM files can be combined into a single
larger .COM file called XEQ.COM. Then, the individual
commands are executed by prefixing them with "XEQ".
Finally, the entire collection of commands can be SCRNCHed
in Run Mode. This technique provides a high degree of
compression, while still retaining the ability to execute
compressed programs directly from the DOS command line.
DeSCRNCHing happens automatically and transparently, except
for a slight delay. All the facilities of XEQ are retained
after it is SCRNCHed, but any updates to the XEQ library
cause the compression to be lost. After adding or deleting
a program from XEQ.COM, SCRNCH must be done again.




 December 30, 2017  Add comments

Leave a Reply