home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
vcomp
/
manual.doc
< prev
next >
Wrap
Text File
|
1992-03-05
|
26KB
|
700 lines
Visual Compare
Version 1.32
A file comparison utility for programmers.
Copyright Notice
Copyright (C) John R. Whitney 1991
All rights reserved.
Trademarks
IBM and OS/2 are registered trademarks of International Business
Machines Corporation.
Lotus is a registered trademark of Lotus Development Corporation.
Intel is a registered trademark of Intel Corporation.
Microsoft is a registered trademark of Microsoft Corporation.
Disclaimer and Agreement
Visual Compare is supplied as is, without any warranty. To the
extent permitted under applicable law, Whitney Software, Inc.
disclaims all warranties, either express or implied, including but
not limited to implied warranties of merchantability and fitness for
a particular purpose.
In no event shall Whitney Software, Inc. be liable for any damages
whatsoever (including, without limitation, damages for loss of
business profits, business interruption, loss of business
information, or other pecuniary loss) arising out of the use of or
inability to use this Whitney Software, Inc. product, even if Whitney
Software, Inc. has been advised of the possibility of such damages.
Some states do not allow the exclusion of liability for consequential
or incidental damages, so the above limitation may not apply to you.
Visual Compare is a "shareware program" and is provided at no charge
to the user for evaluation. Feel free to share it with your friends,
but you may not give it away altered or as part of another system.
The essence of "user-supported" software is to provide personal
computer users with quality software without high prices, and yet to
provide incentive for programmers to continue to develop new
products. If you find this program useful and find that you are
using Visual Compare and continue to use Visual Compare after a
reasonable trial period, you must make a registration payment of $49
to Whitney Software, Inc. The $49 registration fee will license one
copy for use on any one computer at any one time. You must treat
this software just like a book. An example is that this software may
be used by any number of people and may be freely moved from one
computer location to another, so long as there is no possibility of
it being used at one location while it's being used at another. Just
as a book cannot be read by two different people at the same time.
Commercial users of Visual Compare must register and pay for their
copies of Visual Compare within 30 days of first use or their license
is withdrawn. See the file LICENSE.DOC for a site-license agreement.
Anyone distributing Visual Compare for any kind of remuneration must
first contact Whitney Software, Inc. for authorization.
You are encouraged to pass a copy of Visual Compare along to your
friends for evaluation. Please encourage them to register their copy
if they find that they can use it. All registered users will receive
a copy of the latest version of Visual Compare.
Technical Support
If you have any questions or comments regarding Visual Compare,
please send them to CompuServe ID 70661,3463 or:
Whitney Software, Inc.
P.O. Box 4999
Walnut Creek, CA 94596 USA
Table of Contents
_____________________________________________________________________
Introduction ...................................................... 1
Starting Visual Compare ........................................... 2
Visual Mode ...................................................... 12
Miscellaneous Notes .............................................. 13
Introduction 1
_____________________________________________________________________
This manual describes how to use the Visual Compare program to
compare two program source files. This manual and the Visual Compare
program were written for programmers.
Using Visual Compare's visual mode you can easily see the differences
between two program source files and you can also selectively discard
differences in order to quickly undo some of the changes that were
made.
Visual Compare requires an IBM Personal Computer or 100% compatible
running DOS version 2.1 or later or OS/2 version 1.1 or later.
Visual Compare uses a compare algorithm that has been mathematically
proven to always produce a shortest possible sequence of insertions
and deletions that will convert file one to file two.
Starting Visual Compare 2
_____________________________________________________________________
There are two ways to control the start of Visual Compare:
1. Through arguments specified on the Visual Compare command line.
2. Through commands specified in the Visual Compare initialization
file.
Visual Compare Command Line
Run Visual Compare with no arguments to see a list of the available
command line arguments.
The form of the Visual Compare command line is as follows:
VCOMP fileone filetwo [options]
VCOMP
The name of the program module for the DOS version. VCOMPP is the
name of the program module for the OS/2 version.
fileone
The first of two files you wish to compare.
filetwo
The second of two files you wish to compare.
If fileone or filetwo ends with a backslash (\) symbol, the filename
(file name and optional extension) from the other fileone or filetwo
command line argument is appended. This can be convenient if file
one and file two are in different subdirectories and have the same
filename. For example:
VCOMP \OLD\ \NEW\SUPER.C
is equivalent to
VCOMP \OLD\SUPER.C \NEW\SUPER.C
Starting Visual Compare 3
_____________________________________________________________________
options
The following options may be specified with a leading / or -,
whichever you prefer:
/B
Same as the BLACKANDWHITE initialization file command.
Use /B to tell Visual Compare that you have a monochrome display
attached to your computer.
Visual Compare can usually determine whether you have a color or
monochrome display. If you have a color display, Visual Compare
takes advantage of this and uses colors on the screen.
However, if you have a CGA (Color Graphics Adapter), Visual Compare
can't tell whether you have a monochrome or color display. Since
Visual Compare will assume you have a color display, you may wish to
use /B to tell Visual Compare otherwise.
/Tn
2-64
Default value: 8
Same as the TABWIDTH initialization file command.
Specifies the tab width to be used when expanding tabs or compressing
spaces.
/25
Displays 25 lines in visual mode.
/43
Displays 43 lines in visual mode if you have an EGA (Enhanced
Graphics Adapter).
/50
Displays 50 lines in visual mode if you have a VGA (Video Graphics
Array).
Starting Visual Compare 4
_____________________________________________________________________
/S[-]
Writes an edit script to standard output that will consist of a
shortest possible sequence of insertions and deletions that will
convert file one to file two.
Specify /S- to write the edit script in reverse order (from the end
of file to the beginning of file). This can be useful if you are
using an editor to convert file one to file two using the edit
script, since modifying the end of file one will not effect the line
numbers in the edit script that refer to earlier lines in file one.
/C
Writes a composite file to standard output that is the same as the
composite file displayed in visual mode except that strings are used
to delimit text unique to file one or file two instead of colors.
Use the ONESTART, ONEEND, TWOSTART, and TWOEND initialization file
commands to specify the strings used to delimit text unique to file
one or file two. By default, ONESTART equals "$$$$$ fileone START
$$$$$", ONEEND equals "$$$$$ fileone END $$$$$", TWOSTART equals
"$$$$$ filetwo START $$$$$", and TWOEND equals "$$$$$ filetwo END
$$$$$." Where "fileone" and "filetwo" represent the fileone and
filetwo command line arguments.
One reason you might use this option is to run Visual Compare from
within your editor in order to display output similar to that
displayed in visual mode, in an editor window while you edit file two
or file one in another editor window.
/D
Writes a file to standard output that consists of information about
each difference. The information consists of the corresponding file
positions for file one and file two, whether the difference is an
insertion or deletion, and the number of lines inserted or deleted.
You might use this option to interface a program of your own design
to Visual Compare.
Starting Visual Compare 5
_____________________________________________________________________
/En
0-32736
Default value: 32736
The edit distance is defined as the length of a shortest possible
sequence of insertions and deletions that will convert file one to
file two.
Use /En to set the maximum edit distance. If you specify a value
greater than 32736, Visual Compare will use 32736. If while
comparing files the maximum edit distance is exceeded, Visual Compare
will display an appropriate message and abort.
Use this option if you are comparing files that may be too different
for the comparison to be useful and you don't want to wait for Visual
Compare to complete the comparison if the comparison won't be useful.
/I
Same as the IGNORE initialization file command.
Ignores leading space and tab characters when comparing lines. Use
/I if you are not interested in changes in the indentation of lines.
Visual Compare Initialization File
Visual Compare automatically processes an initialization file called
VCOMP.INI at the start of execution.
Visual Compare first looks for VCOMP.INI in the current working
directory. If it doesn't find VCOMP.INI, it next looks in the
directories specified by the PATH environment variable.
The initialization file commands can be abbreviated. For example,
the TABSOUT command can be entered as TABS, TABSO, TABSOU, or
TABSOUT. The shortest legal abbreviation for a command is indicated
by showing that portion of the command in uppercase and the rest of
the command in lowercase.
Some of the initialization file commands have command line option
counterparts. If both the initialization file command and the
corresponding command line option are specified, the command line
option will override.
Starting Visual Compare 6
_____________________________________________________________________
The available initialization file commands are as follows:
Attributes
Use ATTRIBUTES to control the colors Visual Compare uses on the
screen.
An attribute value is associated with each type of field that Visual
Compare displays. The following table lists the seven different
field types displayed by Visual Compare. Use ATTRIBUTES to specify
an attribute value for each field type, in the order of the table
below.
Field Description
----------------------------------------------------------
Common lines common to file one and file two
Delete lines deleted from file one
Insert lines inserted from file two
Function function key and file name lines
Window help and prompt windows
Error error message windows
Key keys in help and prompt windows
Attribute values are numbers ranging from 0 to 255. Different
attribute values cause text to appear in different colors,
highlighted, blinking, etc. On most display adapters that handle
color, you can use the following table to determine the attribute
value corresponding to a given color. Add the number corresponding
to the desired foreground color to the number corresponding to the
desired background color. To also get blinking, add 128.
Foreground Background
-------------------------------
0 black 0 black
1 blue 16 blue
2 green 32 green
3 cyan 48 cyan
4 red 64 red
5 magenta 80 magenta
6 brown 96 brown
7 white 112 white
8 gray
9 light blue
10 light green
11 light cyan
12 light red
13 light magenta
14 yellow
15 bright white
Starting Visual Compare 7
_____________________________________________________________________
On a MDA (Monochrome Display Adapter), the available attribute values
are 7 for normal text, 15 for highlighted text, 65 for underlined
text, and 112 for reverse video text. To also get blinking, add 128
to any of these values.
Examples:
ATTRIBUTES 27 28 26 30 63 79 15
The default attribute values used by Visual Compare on a CGA (Color
Graphics Adapter), an EGA (Enhanced Graphics Adapter), or a VGA
(Video Graphics Array).
ATTRIBUTES 7 112 15 7 112 112 15
The default attribute values used by Visual Compare on a MDA
(Monochrome Display Adapter).
Blackandwhite
Same as the /B command line option.
Use BLACKANDWHITE to tell Visual Compare that you have a monochrome
display attached to your computer.
Visual Compare can usually determine whether you have a color or
monochrome display. If you have a color display, Visual Compare
takes advantage of this and uses colors on the screen.
However, if you have a CGA (Color Graphics Adapter), Visual Compare
can't tell whether you have a monochrome or color display. Since
Visual Compare will assume you have a color display, you may wish to
use BLACKANDWHITE to tell Visual Compare otherwise.
Starting Visual Compare 8
_____________________________________________________________________
Expanded
YES or NO
Visual Compare keeps the contents of the files you are comparing in
memory. The DOS version of Visual Compare can use up to four
megabytes of DOS and EMS memory (Lotus-Intel-Microsoft Expanded
Memory Specification, version 3.0 or later) to store your files. If
Visual Compare detects that EMS memory is present in your system, it
will automatically use it.
The EXPANDED command is ignored by the OS/2 version of Visual
Compare.
Use EXPANDED NO to tell Visual Compare to ignore any EMS memory in
your system, and to use only DOS memory. You may need to use
EXPANDED NO if your EMS driver is not compatible with Visual Compare.
You may also want to use EXPANDED NO for performance reasons.
Height
25, 43, or 50
Use HEIGHT to tell Visual Compare how many lines to display in visual
mode. You must have either an EGA (Enhanced Graphics Adapter) or a
VGA (Video Graphics Array) for this command to have any effect.
Ignore
Same as the /I command line option.
If you are not interested in changes in the indentation of lines, use
IGNORE to tell Visual Compare to ignore leading space and tab
characters when comparing lines.
SHadow
YES or NO
Use SHADOW to tell Visual Compare whether or not windows should have
shadows.
Starting Visual Compare 9
_____________________________________________________________________
SNowcontrol
YES or NO
The IBM Color Graphics Adapter (CGA) requires special programming to
prevent "snow" from appearing on the screen when a program changes
the contents of the screen. The special programming slows down
screen updating and is not necessary for most other display adapters.
If Visual Compare detects a MDA (Monochrome Display Adapter), an EGA
(Enhanced Graphics Adapter), or a VGA (Video Graphics Array), it does
not "desnow." If Visual Compare detects a CGA, it will try to
determine whether "desnowing" is necessary.
The SNOWCONTROL command is ignored by the OS/2 version of Visual
Compare because OS/2 automatically performs "desnowing" if necessary.
If you suspect that Visual Compare is "desnowing" when it is not
necessary, you may want to use SNOWCONTROL NO which will allow Visual
Compare to run faster.
If your computer "locks up" when you run Visual Compare, use
SNOWCONTROL NO.
If Visual Compare incorrectly determines that your CGA does not
require "desnowing", you can force Visual Compare to "desnow" by
using SNOWCONTROL YES.
TABSout
Use TABSOUT to tell Visual Compare to compress spaces in the
composite file to tab characters (using the default tab width of 8 or
the tab width specified by the TABWIDTH initialization file command
or the /Tn command line option) before writing the composite file to
disk. Spaces appearing after the first single or double quote on a
line are not compressed and single spaces are not changed to tab
characters.
TABSOUT effects the composite file written to disk by the visual mode
F2 write function and has no effect on the composite file written to
standard output by the /C command line option.
Starting Visual Compare 10
_____________________________________________________________________
TABWidth
2-64
Default value: 8
Same as the /Tn command line option.
Specifies the tab width to be used when expanding tabs or compressing
spaces.
ONEStart
"string" or 'string'
Default value: "$$$$$ fileone START $$$$$"
If the /C command line option is specified, ONESTART specifies the
string to be written to standard output at the start of text that is
unique to file one. The "fileone" in the default value represents
the fileone command line argument.
ONEEnd
"string" or 'string'
Default value: "$$$$$ fileone END $$$$$"
If the /C command line option is specified, ONEEND specifies the
string to be written to standard output at the end of text that is
unique to file one. The "fileone" in the default value represents
the fileone command line argument.
TWOStart
"string" or 'string'
Default value: "$$$$$ filetwo START $$$$$"
If the /C command line option is specified, TWOSTART specifies the
string to be written to standard output at the start of text that is
unique to file two. The "filetwo" in the default value represents
the filetwo command line argument.
Starting Visual Compare 11
_____________________________________________________________________
TWOEnd
"string" or 'string'
Default value: "$$$$$ filetwo END $$$$$"
If the /C command line option is specified, TWOEND specifies the
string to be written to standard output at the end of text that is
unique to file two. The "filetwo" in the default value represents
the filetwo command line argument.
Working
YES or NO
Use WORKING to tell Visual Compare whether or not to display the
"Working" message.
Here is an example initialization file:
SN NO
TABW 4
ONES "!!!!! ONE START !!!!!"
ONEE "!!!!! ONE END !!!!!"
TWOS '!!!!! TWO START !!!!!'
TWOE '!!!!! TWO END !!!!!'
Don't "desnow", use a tab width of 4, and if the /C command line
option is specified, use the given strings to delimit text unique to
file one or file two.
Visual Mode 12
_____________________________________________________________________
Visual Compare can be run in batch mode by using the /C or /S command
line option. However, most of the time you will probably run Visual
Compare in visual mode. In visual mode you can easily see the
differences between two program source files and you can also
selectively discard differences in order to quickly undo some of the
changes that were made.
If the /C or /S command line option is not given, Visual Compare will
enter visual mode. In visual mode you will be presented with a
scrollable display of a composite of file one and file two. The
composite file consists of lines that are common to file one and file
two, lines unique to file one (deleted from file one), and lines
unique to file two (inserted from file two). Invoke the F1 help
function to see a list of the available functions and their keys.
To selectively discard differences, use the F7 remove one function,
the F8 remove two function, the Del key, and the Shift-Del key to
remove insertions and deletions from the composite file. Then invoke
the F2 write function to write the modified composite file to disk.
All lines in the composite file except those that have been removed
will be written to disk. When you invoke the F2 write function, you
will be prompted for a composite file name.
Use the F5 show/hide function to display insertions and deletions
that have been removed. Use the F4 number function to mark the
removed insertions and deletions. Use the Ins and Shift-Ins keys to
unremove insertions and deletions. To use the Ins or Shift-Ins key
to unremove an insertion or deletion, you must first position the
cursor on the removed insertion or deletion (the removed insertion or
deletion must be displayed with the F5 show/hide function).
If there are lines that are too long to be completely displayed, use
the right and left arrow keys, the End key, and the Home key to
horizontally scroll the display. The End key will scroll the display
so that the last character of the longest displayed line is visible.
Miscellaneous Notes 13
_____________________________________________________________________
Lines in file one and file two can be delimited with Cr, Lf, or
Cr-Lf. The maximum allowed line length in file one and file two is
255 characters. The maximum number of lines that file one and file
two each can contain is 16368. The maximum number of lines that the
composite file can contain is 16368.
Visual Compare will normally terminate with a return code of 0.
However, if Visual Compare determines that file one and file two are
identical, it will display an appropriate message and terminate with
a return code of 1. Also, if Visual Compare encounters an error
condition while not in visual mode, it will display an appropriate
message and terminate with a return code of 2.