                                                   fixmanul.txt 04-97






                                               


                                               


                                               


                                               


                                               


                                               


                              FIX 5.10 USER'S MANUAL


                                    April 1997


                                               


                                               


                                               


                                               


                                  NovaLogic(TM)
                                13585 SW Pommel Ct
                             Beaverton, OR 97008 USA
                                               
                              voice: (503) 524-9184
                           email: novlogic@teleport.com
                     ftp://ftp.teleport.com/vendors/novlogic/














::

                                               
                                               
                                               
                                               
                                       - i -

                                     CONTENTS
            
                 DISCLAIMER OF WARRANTEE ..................  ii
            
            Introduction .......................................   1
            
            Quick Start ........................................   1
            
            Uses for FIX .......................................   2
            
            Syntax .............................................   3
            
            On-line Help .......................................   3
            
            Command Strings and Files ..........................   3
            
            Optional Modes of Operation ........................   4
                Help Guide (-h) ................................   4
                Transform All Lower Case (-a) ..................   4
                Transform All Upper Case (-A) ..................   4
                Count Strings (-c) .............................   4
                DOS Filter Mode (-f) ...........................   5
                Case Insensitive Search (-i) ...................   5
                Log Activity Reports (-l) ......................   5
                Mute Report to Screen (-m) .....................   6
                Query Before Change (-q) .......................   6
                Unix Text Mode (-u) ............................   7
                No Backup Mode (-X) ............................   7
            
            Specify Strings ....................................   7
            
            Special String Conditions ..........................   8
            
            Specify Input/Output Files .........................  10
            
            Output .............................................  10
            
            Halt Execution .....................................  11
            
            Protection Overwriting Existing File ...............  12
            
            Protection FIXing File to Self .....................  12
            
            Return Code ........................................  14
            
            Requirements .......................................  14
            
            Limits .............................................  14
            
               Appendix A - File FIXing Primer .................  16
               Appendix B - Comparison FIX Configurations ......  17
               Appendix C - Complimentary Batch Utilities ......  18
               Appendix D - Installation .......................  19





::

                                               
                                               
                                               
                                               
                                      - ii -


                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                                               
                              DISCLAIMER OF WARRANTY
                                               
                                               
                                               
            THIS SOFTWARE AND MANUAL ARE OFFERED "AS IS" AND WITHOUT
            WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY.  THE FIX
            PROGRAM AND BATCH UTILITIES ARE SOLD WITHOUT ANY EXPRESS
            OR IMPLIED WARRANTIES WHATSOEVER.  BECAUSE OF THE
            DIVERSITY OF CONDITIONS AND HARDWARE UNDER WHICH THESE
            PROGRAMS MAY BE USED, NO WARRANTY OF FITNESS FOR A
            PARTICULAR PURPOSE IS OFFERED.  THE USER IS ADVISED TO
            TEST THE PROGRAMS THOROUGHLY BEFORE RELYING ON THEM.  THE
            USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAMS.
            ANY LIABILITY OF LICENSOR/PUBLISHER OR AUTHOR WILL BE
            LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF
            THE PURCHASE PRICE.
            
            
            
            
            
            
            
           Copyright (C) 1993-1997 NovaLogic.  All rights reserved.























::

            
            
            
            
                               Fix User's Manual          Page 1 of 20


           INTRODUCTION
           ------------
            FIX is a simple file maintenance utility that will find
            and replace instances of any byte string in any size or
            type of IBM-PC[1] file (see Appendix A).  Its virtues are
            flexibility, speed, and built-in data protection.  There
            are 3 configurations of FIX with progressively greater
            functionality (see Appendix B):
            
             (1) FIX 5.10S, the SHAREWARE configuration: provides
                 basic function but includes a randomly appearing
                 promotional screen; data safety is a key feature.
                 
             (2) FIX 5.10R, the REGISTERED configuration: eliminates
                 the promotional screen; adds operating modes: count
                 only, dos filter, mute, query before change; adds
                 delimited findstring; and includes a larger set of
                 complimentary .BAT utilities (see Appendix C).
                 
             (3) FIX 5.10L, the LICENSED configuration: adds multifile
                 capability by accepting the wildcards (?) and (*) in
                 input filenames; accepts a "same directory" wildcard
                 (*\) for the outfile's drive-path; supports case
                 insensitive search; adds the ability to guarantee
                 exclusive replacestring; adds specification of
                 commands and quotes by file; adds capability of
                 maintaining a cumulative log file of FIX activity; .
                 
            See the text file FIXLICEN.TXT for the license available
            for each these configurations of FIX.  To Register or
            License FIX - print out and use the order form/mailer in
            file FIXORDER.FRM, or order by email or phone.
            
            
           QUICK START
           -----------
            See Appendix D for detailed installation instructions.
            
             (1) Install the FIX file set in it's own directory on
                 your system's hard disk.  If you have the Shareware
                 configuration of FIX the file set must be "unzipped"
                 from the distribution file FIX510S.ZIP.  If you have
                 the Registered or Licensed configuration the files
                 may be simply copied from the distribution disk.
                 
            ____________________
                 [1] FIX is a trademark of NovaLogic.  NovaLogic is a
            trademark of John F Crist.  MS-DOS and Windows are
            trademarks of Microsoft Corp.  IBM-PC, PC-AT and PS/2 are
            trademarks of IBM Corp.  8086, 8088, 80286, 80386, 80486 &
            Pentium are trademarks of Intel Corp.






::

            
            
            
            
                               Fix User's Manual          Page 2 of 20


             (2) Include FIX in your system's search path for
                 executable files.  Add the FIX directory spec to the
                 "PATH ..." statement in the AUTOEXEC.BAT file located
                 in the root directory of your hard disk; then reboot.
                 
             (4) Install FIX as a "program item" in MS Windows.  Set
                 up Windows to "execute" the file FIXWIN.PIF which
                 pops up a DOS window in which to run FIX.
                 
             (3) Execute the command: >FIX -h  for an index of help
                 topics.  Execute: >FIX  for general guidance in using
                 the FIX program.  Execute the command: >FIXUTILS  for
                 an overview of the included batch utilities.
                 
                 
           USES FOR FIX
           ------------
            FIX was designed for use by programmers editing/
            maintaining a set of source code files making up a large
            computer program.  However, users have also found FIX
            useful for maintaining data base or system configuration
            files (e.g. Windows .INI) to accommodate new users or a
            change in hardware drivers.  Or to change recurring format
            or content in a Web page (.HTM) file.  And FIX can always
            be used to change occurrences of a misspelled or incorrect
            word in some large body of text.  While this can be done
            with your editor or word processor, it can be done more
            quickly using FIX if it's the only change to be made.
            
            But FIX can do something that most editors or word proces-
            sors can't, and that is make mass changes to non-printing
            control characters.  This permits changing all single
            spaced lines to double spaced in a large text file, or re-
            formatting a large source code file by shifting all inden-
            ted lines right, or left, by 1 tab.  For more examples see
            the included .BAT utilities.  FIX may even be used on
            binary files to "patch" small portions of code or data.
            
            The power of FIX becomes more apparent in the LICENSED
            configuration which enables you to address a set of files.
            This makes it possible to correct a string which may have
            occurred any number of times in each of the multiple files
            which comprise some very large document, computer program,
            or system configuration.  You can find the target string
            wether or not it has been capitalized.  You can keep a
            permanent record of your FIX activity in a log file which
            you may locate in the current directory, in the same
            directory as the source file, or in a fixed log directory.
            You can manipulate extremely long find/replace strings.
            Judicious application of Licensed FIX can save you many
            keystrokes in maintaining a large set of related files.






::

            
            
            
            
                               Fix User's Manual          Page 3 of 20


           SYNTAX
           ------
           
            FIX  [-aAcfhilmquX]  FINDSTRING  REPLACESTRING
                               [d:][path]FILENAME  [d:][path][outfile]
            
            The mandatory command line arguments are: (1) findstring,
            (2) replacestring and (3) filename.  Optionally the user
            may specify an output filename, and may also specify disk
            drive(s) and directory path(s) for input and/or output
            files.  FIX also accepts optional mode switch(es) as the
            first argument.  The LICENSED configuration accepts the
            wildcard characters (?) and (*) in the input filename, and
            the "same path" wildcard (*\) in the output filespec.
            Command line arguments are separated by one or more
            spaces.
            
            
           ON-LINE HELP
           -----------
            On-line help for most features is available at the DOS
            command line.  Enter:  >fix -h  to display an index of
            help topics.  The general help screen may be displayed by
            the command:  >fix  with no arguments.  Help specific to
            any of the optional modes of operation, including compati-
            bility with other modes, may be displayed by including the
            mode switch as the only argument:  >fix -a .  And help on
            the major features is invoked by a 2 character symbol for
            the feature:  >fix -().
            
            Help is also available for the complimentary batch
            utilities.  The command:  >fixutils  will display an
            overview of the utilities, and entering the name of the
            utility with no arguments:  >x2lines  will invoke help for
            that utility.  (Appendix C).
            
            
           COMMAND STRINGS AND FILES
           -------------------------
            MS-DOS limits the FIX command line, including quoted
            findstring and replacestring, to a total length of 127
            characters.  However, FIX "command strings" and "command
            files" permit specification of command elements and string
            quotes of virtually unlimited length.  They also facili-
            tate the repeated issue of long complex commands.
            
            A "command string" is an MS-DOS environment string varia-
            ble which has been "SET" to the value of a FIX command or
            element(s) of a command.  The string may then be inserted
            by reference in the FIX command line by preceding the
            string name with the (&) character.  Syntax: &stringname.






::

            
            
            
            
                               Fix User's Manual          Page 4 of 20


            Findstring and replacestring may be specified by reference
            by enclosing the (environment) string name in quote marks.
            Syntax: &"stringname".  Note that alternate "quote" marks
            which impose special string conditions ((), {}) may be
            used.  Command strings may contain only the printable
            ASCII characters which can be "SET" in an environment
            string, this excludes the characters: (<) (<) (=) (|).
            
            "Command files" are MS-DOS files which contain a FIX
            command or element(s) of a command.  File content is
            inserted by reference in the command line by preceding the
            filename with the (@) character.  Syntax: @filename or
            @"filename".  Quoted files may contain any byte values.
            However, the MS-DOS end-of-file character (1Ah) is
            disregarded when it terminates file that is quoted.
            
            Unquoted command strings and command files may themselves
            contain references to other command strings and command
            files, and these may be nested to multiple levels.
            
            
           OPTIONAL MODES OF OPERATION
           ----------------------------
            FIX's power and range are extended by alternate modes of
            operation.  Modes may be invoked by inserting one or more
            switches as the first argument(s) in the command line.
            The LICENSED configuration supports the full set of mode
            switches: [-aAcfhilmquX].
            
             HELP GUIDE (switch: -h ):
                 The Help Guide provides an index to on-line
                 help available for each mode and major feature.
                 Syntax: FIX -h .
                 
             ALL LOWER CASE TRANSFORM (switch: -a )
                 Transforms all alphabetic characters to lower case.
                 Syntax:  FIX -a  [drive:][path]FILENAME
                 [drive:][path][outfile].
                 
             ALL UPPER CASE TRANSFORM (switch: -A )
                 Transforms all alphabetic characters to upper case.
                 Syntax:  FIX -A  [drive:][path]FILENAME
                 [drive:][path][outfile].
                 
             COUNT STRINGS (switch: -c, or -# ):
                 Count Mode displays the count of findstring
                 occurrences in each file without making changes to
                 the file.  It's action is similar to that of the
                 "grep -c" command of the UNIX operating system,
                 except that string content here is not confined to
                 the printable ASCII characters.  Count mode command






::

            
            
            
            
                               Fix User's Manual          Page 5 of 20


                 syntax:  FIX -c  FINDSTRING  [drive:][path]FILENAME.
                 Count mode presents the user with another means for
                 examining a set of files before committing to change.
                 
             DOS FILTER MODE (optional switch: -f ):
                 Filter Mode enables FIX to work with piped ( | ) or
                 redirected (<),(>) I/O rather than with file set(s)
                 specified in the command line.  The mode switch
                 forces FIX into Filter Mode and assures correct error
                 messages if there is a syntax problem.  However, if
                 FIX senses piped or re-directed input on the command
                 line, it will switch to Filter Mode automatically
                 without the mode switch being set.  Once in Filter
                 Mode, FIX reads input text from the Standard Input
                 Device and writes output text to the Standard Output
                 Device.  If Standard Output has not been redirected
                 from the console, the FIX activity report is
                 suppressed so that only the output text will appear
                 on the screen.  If Standard Output has been re-
                 directed, FIX writes it's activity report to the
                 system console as usual.
                 
                 In Filter Mode FIX can work in series with other
                 Filter programs such as SORT and FIND provided with
                 MS-DOS.  This provides the user with the power and
                 flexibility of performing ad hoc text manipulations
                 as a piped series of filter operations.  Filter Mode
                 syntax:  [filter | ]  FIX  [-faAcilmu]  FINDSTRING
                 REPLACESTRING  [<infile]  [>outfile]  [ | filter].
                 
             CASE INSENSITIVE SEARCH (switch: -i ):
                 Case insensitive mode matches findstring with
                 character patterns in text without regard to case
                 (upper/lower) of either findstring or text.
                 
             LOG ACTIVITY REPORTS (initiated by switch: -l ):
                 Logfile mode writes activity reports to a file,
                 maintaining a cumulative permanent record of FIX
                 activity.  Each report includes: a date-time stamp,
                 the directory from which FIX was invoked, the command
                 line entry, and an abbreviated form of the activity
                 report appearing on the screen.  The switch (-l)
                 initiates Logfile Mode by creating the file
                 FIXLOG.TXT in the current directory.  With this file
                 in place, this and any subsequent invocations of FIX
                 from this directory will be logged without further
                 need for the (-l) switch.  Active Logfile Mode is
                 announced by a screen report ending with "Logged.".
                 
                 Rather than using the (-l) switch, the user may
                 assert greater control in Logfile Mode by setting






::

            
            
            
            
                               Fix User's Manual          Page 6 of 20


                 a string in the MS-DOS environment to specify
                 [D:][PATH][NAME] for the logfile.  Following are
                 examples of the SET instruction which might be
                 included in AUTOEXEC.BAT. If the logfile name is not
                 specified, the default FIXLOG.TXT is assumed.  Either
                 of two keywords, one short and one long, may be used:
                    SET FXL=C:\LOG\LOGFIL.TXT : fixed directory
                    SET FXL=A:                : current dir on A:
                    SET FIXLOG=b (b=blank)    : current directory
                    SET FIXLOG=*\HISTORY.TXT  : infile's directory
                 Note that the last example uses the "same directory"
                 wildcard (*\) to place the logfile in the directory
                 with the file being FIXed.  Control precedence when
                 multiple specs: (1) command line switch, (2) spec in
                 DOS environment, (3) FIXLOG.TXT in current directory.
                 
                 Information on current logfile status is included in
                 mode specific help called by the command:  FIX -l .
                 
             MUTE REPORT TO SCREEN (switch: -m ):
                 Mute Mode suppresses the activity report to the
                 screen, displaying only the copyright message.  This
                 mode supports the use of FIX in .BAT programs where
                 only the string count returned in the ERRORLEVEL
                 variable may be relevant.  It can also be useful in
                 combination with DOS Filter Mode (-mf) where the
                 report to the screen may not be useful.
                 
             POP-UP SCREEN (switch: -p ):
                 In the Shareware configuration of FIX, a pop-up
                 promotional screen appears randomly after 1 in 4
                 executions.  Setting the -p switch displays this pop-
                 up screen without execution.
                 
             QUERY BEFORE CHANGE (switch: -q ):
                 Query Mode enables the user to cancel changes to a
                 file after informing the user of the number of
                 strings that will be changed.  FIX makes a first pass
                 through the input file to count occurrences of
                 findstring, then presents this number to the user
                 along with 4 options: (Yes/Cpy/No/All).  If the user
                 responds <Y> followed by <Enter> then occurrences of
                 findstring will be changed to replacestring in a
                 second pass through the file.  With the <C> response
                 FIX will copy the input file to the output file
                 without changing strings.  With the <N> response FIX
                 will proceed to the next input file with no action on
                 the current file.  Pressing the <A> key will cancel
                 query mode and process this and all subsequent files
                 normally.  The query mode helps the user to avoid the







::

            
            
            
            
                               Fix User's Manual          Page 7 of 20


                 "surprise" of unintended changes.
                 
             UNIX TEXT MODE (switch: -u )
                 Unix text mode assumes that FIX is processing a Unix
                 text file rather than (the default) MS-DOS text.  The
                 difference lies in the control characters that will
                 be recognized.  In Unix text a "newline" is repre-
                 sented by a single linefeed char (0Ah), and there is
                 no "end-of-file" character.  In MS-DOS text a
                 "newline" is represented by two characters - a car-
                 riage return (0Dh) followed by a linefeed (0Ah); and
                 MS-DOS uses an "end-of-file" char (1Ah).  Note that
                 Unix text mode is relevant only if you are using the
                 symbols: (^) beginline, ($) endline, or (\n) newline
                 in specifying either findstring or replacestring.
                 
             NO BACKUP MODE (switch: -X)
                 No backup mode suppresses creation of the .BAK file
                 that normally preserves original data when FIXing a
                 file to itself.  This mode also suppresses the
                 overwrite query that is displayed when a specified
                 output file already exists.  It permits users to
                 avoid data security measures where it's expeditious.
             
                 
           SPECIFY STRINGS
           ---------------
            A byte string may be specified by:
            
             (1) a literal enclosed in quotes - "string", or enclosed
                 with parens or braces to impose certain conditions.
                 
             (2) a sequence of decimal byte values separated by
                 commas - 115,116,114,105,110,103
                 
             (3) a sequence of hex byte values terminated by 'h'
                 or 'x' - 737472696e67h [2]
                 
             (4) command line reference to a quoted ms-dos environment
                 string - &"strname", or a quoted file - @"filespec"
                 


            ____________________
                 [2] Each byte must be represented by 2 hexidecimal
            digits regardless of byte value; the 2 hex digits are
            entered conventionally with the high order digit first.
            However, the bytes are entered in "string" order - low
            byte to high byte as arrayed in memory - NOT the high to
            low byte order conventionally representing a multi-byte
            binary number.






::

            
            
            
            
                               Fix User's Manual          Page 8 of 20


             (5) symbols representing the ascii control characters -
                 (^) beginline, ($) endline, (\n) newline, (\a) BEL,
                 (\c) CR, (\f) FF, (\l) LF, (\t) HT, (\v) VT
                 
             (6) or any contiguous combination of these string specs -
                 "st"114,105,6e67h&str$
                 
            Single quote marks may enclose double quotes or vice versa
            - indeed any delimiting character pair may enclose any
            other delimiters.  Note, however, that only double quotes
            (") may be used to enclose the string characters (>), (<),
            and (|) which otherwise would have meaning in the MS-DOS
            command line.  The null string may be specified by
            adjacent quotes ("").  Methods (1) thru (6) above provide
            convenient and flexible means for representing any
            contiguous sequence of printable or unprintable bytes.
            
            Two of the control character symbols have significance
            beyond their byte values.  The character (^) outside of
            quotes at the beginning of a string represents "begin
            line".  The character ($) outside of quotes at the end of
            a string represents "end line".  In addition to inserting
            the appropriate characters in the string, the placement of
            these symbols causes the search for findstring to recog-
            nize the beginning/end of the infile as also being the
            beginning/end of a line of text.  Either (^) or ($) out-
            side of quotes but not at the beginning/end of the string
            has the same meaning as newline (\n).  Some examples:
            
              Command Line String Specs        Resulting String Change
              -----------------------------    -----------------------
              fix  'Smith'  'SMITH'  file      Smith -> SMITH
              fix  "'no'"  '"no"'  file        'no' -> "no"
              fix  13,10  13,10,13,10  file    1X spaced lines -> 2X
              fix  0d0ah  0d0a0d0ah  file      1X spaced lines -> 2X
              fix  \n  \n\n  file              1X spaces lines -> 2X
              fix  ^'t'  ^'T'  file            t -> T if t starts line
              fix  'st'114,105,6e67h&st$  $ f  del stringxx at endline
            
           SPECIAL STRING CONDITIONS
           -------------------------
            Special string conditions may be specified in the FIX
            command line, accomplished by the use of string delimiting
            marks other than "quote" marks ("" '' !!).  Parens specify
            a "delimited" (findstring) in the REGISTERED and LICENSED
            configurations of FIX.  And the LICENSED configuration
            also supports 2 special conditions for replacestrings:
            braces specify an "exclusive" {replacestring}; and parens
            specify an "exclusive-delimited" (replacestring).  The
            following describes each of these 3 special string
            conditions in more detail.






::

            
            
            
            
                               Fix User's Manual          Page 9 of 20


            
            Parens specifying a (findstring) define a DELIMITED
            FINDSTRING.  This requires that a matching string be
            "delimited" - immediately preceded and followed by
            delimiting characters - in order to be selected in a body
            of text.  For example the findstring spec (to) would
            select the "to" in " go to ", but not the "to" in
            " tomorrow ".  A delimiting character is defined here as
            any byte value that is NOT in the alphanumeric characters:
            [0-9], [A-Z], [a-z], or [_].
            
            Braces specifying a {replacestring} define an EXCLUSIVE
            REPLACESTRING.  Exclusivity requires the only occurrences
            of replacestring in the addressed file(s) to be those that
            are inserted by FIX.  This is accomplished in two passes
            through the file set.  In the first pass FIX scans all
            addressed files for pre-existing occurrences of find-
            string.  If any are found the run is aborted.  If none are
            found, FIX makes a second pass through the file set to
            replace findstrings with the replacestring now known to be
            "exclusive".
            
            Parens specifying a (replacestring) define an EXCLUSIVE-
            DELIMITED REPLACESTRING.  FIX may insert replacestring in
            the file(s) only if the files contain no pre-existing
            "delimited" replacestrings (non-delimited replacestrings,
            however, are allowed).  Again FIX makes 2 passes through
            the file set to satisfy the replacestring condition.
            
            Delimited (findstring) and exclusive-delimited (replace-
            string), together, are useful for changing variable names
            in computer programs, especially when the variable names
            are short and the program source file(s) are numerous and
            large.  These special string conditions assure that:
               (1) only variable names will be changed, and
               (2) the new name is not already in use for some other
                   variable.
            Example:  fix (i) (j) *.c
            
            Note that a string with special conditions may still be
            specified by a combination of means including quoted,
            decimal, hex and symbolic elements; however, if any of a
            string's elements are specified in parens () or braces {},
            the special condition is imposed on the entire string.
            For example the string spec:  "st"7269h(ng)  will treat
            the entire (string) as delimited
            
            To provide the user some flexibility, certain special
            characters may serve as alternatives or back-ups to the
            quote marks, brackets or braces used to specify strings.







::

            
            
            
            
                               Fix User's Manual          Page 10 of 20


            The following groups of delimiter pairs are equivalent in
            effect:  (""  ''  !!),   (()  []  ##),   ({}  %%).
            
            
           SPECIFY INPUT/OUTPUT FILES
           --------------------------
            The user has 3 basic alternatives for specifying input and
            output files on the command line.  The choice of specifi-
            cation method depends on the objective.
            
             (1) Enter ONLY THE INPUT FILESPEC if you wish to FIX a
                 file "in place" or "onto itself".  When no element of
                 an output filespec is entered on the command line,
                 the output file defaults to the input file.  If any
                 strings in the file are changed, the file's original
                 contents are preserved in a .BAK file in the same
                 directory, overwriting any pre-existing .BAK file.
                 This will happen wether the input file is specified
                 in the current, or a remote, directory.
                 
             (2) Specify some element(s) of an OUTPUT FILESPEC
                 (without using the same-path wildcard) if you wish to
                 define the output file relative to the current
                 directory per the MS-DOS Copy model.  Unspecified
                 drive or directory (drive-path), default to the
                 "current" drive or directory, and an unspecified
                 output filename defaults to the input filename.  In
                 an exception to the DOS Copy model, however, an
                 explicit spec for the current directory (.) MUST be
                 entered to FIX a remote file into the current
                 directory (otherwise the file is FIXed in place).
                 
             (3) Use the SAME-PATH WILDCARD (*\) to specify the output
                 file's directory path as identical to the input
                 directory path.  The output drive, if unspecified,
                 defaults to the input drive; and output filename
                 defaults to input filename.  An explicit drive
                 designator may be prepended to the (*\) wildcard, and
                 a subdirectory and/or filename may be appended.  The
                 samepath wildcard facilitates FIXing a remote file
                 into a remote subdirectory:
                    >fix 'x' 'y' a:\aa\bb\file.txt  *\cc
                 or FIXing across devices with mirrored directory
                 structure:
                    >fix  'x' 'y' c:\database\config\*.cfg  d:*\
                 
            
           OUTPUT
           ------
            FIX processing results in 2 bodies of text: (1) the origi-
            nal text, and (2) text that has been altered by replacing






::

            
            
            
            
                               Fix User's Manual          Page 11 of 20


            occurrences of findstring with replacestring.  FIX always
            leaves both bodies of text in file(s) at the conclusion of
            processing (unless directed not to by the -X switch).  The
            attributes and identities of these files vary depending on
            the results of processing, and the user's intentions
            expressed in command line filespecs.
            
            The following rules apply to the attributes and identity
            of resulting text files:
            
             (1) A file containing original text always bears the
                 date/time stamp of the original text.
                 
             (2) A file containing text that has been changed is
                 always stamped with the date/time of FIX processing.
                 
             (3) When the user enters only an input filespec in order
                 to FIX a file or set of files "in place":
                  a) if no changes are made to file text (no
                     occurrences of findstring), the input file and
                     directory remain untouched;
                  b) if text is changed, the input file is renamed
                     with a .BAK extension and the output text is
                     given the input filename; the .BAK file replaces
                     any pre-existing file with the same name.
                     
             (4) When the user specifies different directories, or
                 different names, for the input and output files:
                  a) except for being read, the input file is
                     untouched;
                  b) a separate output file is always generated
                     regardless of changes to the text, and it over-
                     writes (with user permission) any pre-existing
                     file with the same name.
                     
            FIX displays a one line report for each file that is
            processed. It includes: the input filename, the output
            filename (if different from input filename), the number
            of occurrences of findstring that were changed, and
            indication if the file was "BAKed".  If wildcards were
            used to specify the input fileset, the report also
            includes the sequence number of each infile, and at the
            conclusion of processing - the total number of strings and
            files that were changed, and indication if this activity
            report was "Logged".
            
            
           HALT EXECUTION
           --------------
            The user may terminate FIX execution at any point by
            pressing the key combinations <Ctrl><C> or <Ctrl><Break>.






::

            
            
            
            
                               Fix User's Manual          Page 12 of 20


           
           
           PROTECTION OVERWRITING AN EXISTING FILE
           ---------------------------------------
            File overwrite protection is identical to that provided by
            DOS COPY.  When the output file specified by the user
            already exists, the user is queried to confirm intent:
            Overwrite C:\DIR\FILE (Yes/No/All)?.  The user must enter
            a single character indicating intent, followed by the
            <Enter> key.  A mistaken response may be retrieved before
            <Enter> by pressing either the <BackSpace> or <Esc> keys.
           
           
           PROTECTION FIXING FILE TO SELF
           ------------------------------
            In order to insure protection of original data when FIXing
            a file or set of files onto itself in its own directory,
            the FIX program must impose certain constraints on the
            filespecs it will accept:
            
             (1) It is not possible to FIX a file with a .BAK
                 extension onto itself within its own directory.
                 
                   fix  'a'  'A'  filename.bak               : No
                   fix  'a'  'A'  filename.txt               : ok
                   fix  'a'  'A'  filename.bak  newdir       : ok
                   fix  'a'  'A'  filename.bak  newname.bak  : ok
                 
                 If the input file has a .BAK extension and is FIXed
                 onto itself, the changed file text would over-write
                 the original data in its own .BAK file.
            
            The LICENSED configuration of FIX supports the wildcard
            characters (?), (*) in infile name  specification.  Here
            again the behavior of FIX conforms to the COPY model.
            Wildcards used in specification of the infile are applied
            in searching the directory for matching filenames.
            Wildcards in the output filespec are applied to the actual
            name of the input file to generate a corresponding name
            for the output file.  See the MS-DOS 5.0 User's Guide,
            "Using Wildcards", for more detail.
            
            Wildcards introduce the need for additional interlocks to
            protect original data from filespec mishaps when perform-
            ing operations entirely within the current file directory.
            FIX imposes two more constraints which eliminate the
            possibility of over-writing original data (within a single
            FIX run) when processing multiple files:
             
             (2) When FIXing a set of files onto itself within its own
                 directory you may not use wildcard characters in the






::

            
            
            
            
                               Fix User's Manual          Page 13 of 20


                 filename extension:
                 
                   fix  'a'  'A'  indir\flname.tx?     : No
                   fix  'a'  'A'  *.txt                : ok
                   fix  'a'  'A'  flname.tx?  outdir   : ok
                 
                 Wildcards in the filename extension when FIXing-to-
                 self would permit a back-up file to be overwritten by
                 a subsequent back-up file in the same run.
                 
             (3) When using wildcards in infilespec and outfilespec to
                 FIX a set of files onto another set of files within
                 the same directory, the two specified sets of
                 filenames may not intersect (include names in
                 common):
                 
                   fix  'a'  'A'  file*.*    ????name.*    : No
                   fix  'a'  'A'  file*.??a  *.??b         : ok
                 
                 Intersecting filespecs would permit an output file to
                 over-write an input file that is yet to be processed
                 in the same run.
             
                 Intersecting filespecs is an insidious problem
                 encountered with complicated wildcard filespecs.
                 It can be avoided by assuring that infilespec and
                 outfilespec have at least one parallel character
                 position with different (non-wildcard) characters -
                 see 2nd example in (3) above.
                 
                 Note that the outfilespec (*.*) creates a special
                 case when no drives or paths are specified.  It is
                 FIXing-to-self made explicit, and so is treated under
                 constraints (1) and (2) above.
            
            FIX checks for each of these three kinds of data threat-
            ening filespec errors, and stops and issues a message when
            they are detected.  It must be emphasized, however, that
            these three interlocks can prevent over-writing: (1) only
            the original data addressed by infilespec, (2) only with-
            in a single invocation of FIX.  The user must define file-
            specs so that important "other" files (not addressed by
            infilespec) are not overwritten.  And the user must be
            aware, when FIXing-to-self, that 2 runs changing the same
            file will over-write original data in the 1st .BAK file.
            As a matter of routine you should make back-up copies of
            important data before any kind of processing which, like
            FIX, transforms the contents of a file.  Do not rely
            solely on any software's safety features.
            
            






::

            
            
            
            
                               Fix User's Manual          Page 14 of 20


           RETURN CODE
           -----------
            The FIX program returns the number of strings processed in
            an 8 bit "return code" which is passed to MS-DOS at the
            conclusion of processing.  The purpose is to report the
            results of processing back to a parent program.  For
            example the return code may be accessed in a batch (.BAT)
            program by examining the ERRORLEVEL variable immediately
            after FIX has been run.
            
            An ERRORLEVEL of N, with N = 0, 1, 2, 3, ..., 252
            indicates the run was successful with N occurrences of
            findstring changed to replacestring across all files
            examined.  (Or, when the -c switch in the command line has
            invoked "count only" mode, N represents the number of
            occurrences counted.)  In the special case when N = 252,
            the return code indicates that 252 OR MORE strings were
            changed.  The return code for a successful run may not
            exceed the upper bound of 252 regardless of the number of
            strings changed.
            
            The 3 remaining possible values for the 8 bit return code
            are reserved for actual errors as follows:
            
               253  FDh  : Syntax Error
               254  FEh  : Wildcard Filespec Threatens Original Data
               255  FFh  : File Access Error
            
            
           REQUIREMENTS
           ------------
            FIX will run on any of the IBM-PC, PC-AT, PS/2 or com-
            patible series of personal computers based on the Intel
            8086, 8088, 80286, 80386, 80486, Pentium, or higher micro-
            processors.
            
            FIX runs in the MS-DOS operating system, version 2.1 or
            higher.  It also runs in any operating environment that
            supports programs running in MS-DOS - this includes OS/2,
            Windows 3.1, Windows 95 and Windows NT.
            
            FIX requires a computer with at least 256K of conventional
            memory.  It occupies only 128K of memory when running.
            
            
           LIMITS
           ------
            The size of file which may be processed is limited only by
            the computer's available disk space.  For a file to be
            processed successfully there must be enough free space on
            the output drive to hold the new copy of the file's text






::

            
            
            
            
                               Fix User's Manual          Page 15 of 20


            after all specified string changes have been made.  If the
            available disk space is found to be insufficient, proces-
            sing is halted, the partial output file is deleted, and
            the error message "Insufficient disk space" is displayed.
            
            The lengths of findstring and replacestring are con-
            strained by availability of buffer space.  The total of
            the lengths of the 2 strings may not exceed approximately
            42K bytes with a case sensitive search.  With a case
            insensitive search an additional constraint is imposed:
               3 * findstring_length  +  replacestring_length  <  64K.
            If string buffer space is exceeded, processing is halted
            and the appropriate error message is displayed.
            
            The depth to which unquoted command strings and command
            files may be "nested" (command string/file referencing
            another command string/file) is constrained by the space
            reserved for the FIX.COM program stack.  These command
            references may be nested to an approximate depth of 10.
            If stack space is about to be exceeded, processing is
            halted and an error message displayed.
            
            The number of strings which FIX may find and replace in a
            single file, or over multiple files, is unlimited.  How-
            ever, the largest integer value which may be formatted for
            display on the screen is 655,359.  If a string count
            exceeds this limit, a field of asterisks "*******" is
            displayed.
            




























::

            
            
            
            
                                Fix User's Manual         Page 16 of 20


                                    APPENDIX A
                                               
                                FILE FIXING PRIMER


            When using FIX to make changes to a file you must be aware
            of the file's purpose and content, and limit changes
            accordingly to avoid "corrupting" the file.  The following
            describes 3 broad categories of MS-DOS file with necessary
            limitations on the ways they may be changed:
            
             (1) ASCII Text Files - contain the printable ASCII (or
                 extended ASCII) characters, together with ASCII print
                 control characters.  They can be TYPEd to your video
                 screen, and read.  The filename extensions .DOC, .TXT
                 or .ASC usually indicate the file contains ASCII
                 text.  Computer program source code files are another
                 example of plain ASCII text.  Any text change that
                 remains within the ASCII character set is permitted.
                 Printable ASCII character strings are specified for
                 FIX by enclosing them in quotes.  The ASCII control
                 characters must be specified by their decimal or
                 hexidecimal byte values, except for "begin line" and
                 "end line" which may be represented by their
                 respective symbols: (^) and ($).
                 
             (2) Fixed Field Data Files - are made up of records, or
                 contain certain fields, which are fixed in length and
                 must remain so.  Data base files, spread sheet files,
                 and many word processor files are examples of fixed
                 field data.  The data may be ASCII or binary.  When
                 you change a fixed length field, replacestring length
                 in bytes must equal findstring length.
                 
             (3) Binary or Executable Files - contain machine code,
                 instructions to be read/acted upon by a microproces-
                 sor.  When TYPEd to the screen a binary file displays
                 garbage characters.  Examples include files with the
                 .COM or .EXE name extension which are invoked at the
                 command line when you run a program.  Changes to
                 these files must be made cautiously, normally with
                 explicit instructions from the program's author.  Not
                 only must (a) replacestring length equal findstring
                 length, but (b) the changed bytes in replacestring
                 must constitute legitimate microprocessor
                 instructions, and (c) the instructions must be
                 appropriate within the larger context of the
                 program's logic.  "Strings" in binary files are
                 commonly represented by the hexidecimal value of each
                 byte.







::

                                                                                  
                                                                                  
                                                from vendor.txt 04-97
            
            
                                Fix User's Manual        Page 17 of 20

                                    APPENDIX B
                                               
               COMPARISON OF FEATURES - THREE CONFIGURATIONS OF FIX


                                        ------ FIX Configuration -----
            
                                          5.10S      5.10R      5.10L
            FEATURES:                   Shareware  Registered Licensed
            
              Random Promotional Screen   [Yes]      [   ]      [   ]
            
              Upper/Lower Case Transform  [Yes]      [Yes]      [Yes]
            
              Cmnd & Quote by SET String  [Yes]      [Yes]      [Yes]
            
              DOS Filter Mode ..........  [   ]      [Yes]      [Yes]
            
              Count Only Mode ..........  [   ]      [Yes]      [Yes]
            
              Query Before Change Mode .  [   ]      [Yes]      [Yes]
            
              Delimited Findstring .....  [   ]      [Yes]      [Yes]
            
              Exclusive Replacestring ..  [   ]      [   ]      [Yes]
            
              Case Insensitive Search ..  [   ]      [   ]      [Yes]
            
              Wildcards in Filespecs ...  [   ]      [   ]      [Yes]
            
              Command and Quote by File   [   ]      [   ]      [Yes]
            
              Activity Log File ........  [   ]      [   ]      [Yes]
            
            TERMS:
            
              PRICE* from NovaLogic
                 incl Shipped Disk .....   $6         $12      $26/1st
            
              Six Months Email or
                 Telephone Support .....  [   ]      [Yes]      [Yes]
            
              One Year Updates
                 at $4 Disk Price* .....  [   ]      [Yes]      [Yes]
            
              Site License, Commercial
                 Use, Multiple Computers  [   ]      [   ]      [Yes]
            
            
            ______________________
            [*] Prices (04-97) subject to change without notice.






::

            
            
            
            
                                 Fix User's Manual        Page 18 of 20


                                    APPENDIX C
                                               
                          COMPLIMENTARY BATCH UTILITIES


            A set of batch (.BAT) utilities which invoke FIX is
            included in the distribution file set.  They perform pre-
            specified editing functions on ASCII text files.  Their
            purpose is to extend the usefulness of the FIX program;
            and also to provide models for users' development of .BAT
            programs or key macros for their own common editing tasks.
            
            Entering the command "FIXUTILS" at the command prompt will
            display an on-line help screen providing an overview of
            the utilities.  Following are utility names and functions:
            
                 X2LINES     - Doubles the spacing of each line
                               of text.
                 D2LINES     - Changes each double spaced line to
                               a single spaced line.
                 X2TABS      - Replaces each (horizontal) tab with
                               2 tabs.
                 D2TABS      - Replaces each adjacent pair of tabs
                               with a single tab.
                 INDENT      - Inserts 1 tab at the beginning of
                               each line.
                 UPINDENT[*] - Adds 1 more indentation tab to the
                               beginning of each indented line.
                 DEINDENT[*] - Deletes 1 indentation tab from the
                               beginning of each indented line.
                 SPACE2[*]   - Reduces each contiguous sequence of
                               spaces to 2 spaces (an iterative appli-
                               cation which acts on feedback frm FIX).
                 SHIFTBRL[*] - Shifts braces ({),(}) in C source
                               file(s) to the left 1 tab.
                 SHIFTBRR[*] - Shifts braces ({),(}) in C source
                               file(s) to the right 1 tab.
                 GREPC[*]    - Counts strings, syntax/results similar
                               to Unix "grep -c".
            
            The command line syntax, which is common across all of
            these utilities, is:
            
                 UTILNAME [d:][path]FILENAME  [d:][path][outfile]
            
            For on-line help that is specific to the utility, enter
            the utility name with no arguments.
            
            ______________________
                 [*] Provided with Registered and Licensed
            configurations of FIX.






::

            
            
            
            
                                 Fix User's Manual        Page 19 of 20


                                    APPENDIX C
                                               
                                   INSTALLATION


            The SHAREWARE configuration of FIX is distributed in a
            compressed .ZIP file.  The REGISTERED and LICENSED
            configurations are distributed as a set of files on a
            diskette.  Follow instructions appropriate to your
            configuration.
            
            The following instructions assume you are reasonably
            proficient in the use of MS-DOS and Windows, and are able
            to use a text editor to examine and modify text files.
            
             (1) Start up your computer and make the target drive
                 (where you want to install FIX) the "current" drive.
                 Example: >C: (the DOS prompt is ">", you enter "C:"
                 followed by the <Enter> key).
                 
             (2) Create a new file directory on the target drive to
                 hold the FIX file set.  Example: >MAKDIR \FIX
                 
             (3) Make the newly created directory the "current"
                 directory.  Example: >CD \FIX
                 
             (4) If you are loading FIX from a distribution diskette,
                 insert the diskette in an external drive of the
                 appropriate size.  Example: insert the diskette in
                 drive A: and close drive door.
                 
             (5) Copy the FIX distribution file set from the source
                 drive into the current (C:\FIX) directory:
                 
                 For the SHAREWARE configuration you must decompress
                 the distribution .ZIP file using the PKUNZIP [1]
                 utility.  Example: >PKUNZIP A:\FIX510S
                 
                 For the REGISTERED or LICENSED configurations you
                 simply copy the file set from the distribution disk
                 into the current directory.  Example: >COPY A:\*.*
                 
             (6) Include the new FIX directory in your system's
                 "search path".  Use any text editor to examine the
                 AUTOEXEC.BAT file in your computer's root directory.
            ____________________
                 [1] PKUNZIP is a trademark of PKWare Inc, 9025 N
            Deerwood Dr, Brown Deer, WI 53223  (414)354-8699.  These
            instructions assume you are a registered user of the file
            compression/decompression utilities PKZIP/PKUNZIP, avail-
            able through shareware distribution channels.






::

            
            
            
            
                                 Fix User's Manual        Page 20 of 20


                 Look for the statement that begins with the word
                 "PATH" followed by a space or "=", followed by a
                 sequence of directory specs separated by semi-colons
                 ";".  Use the editor to add the new FIX directory to
                 the existing PATH statement.  Example:
                    before -  PATH C:\DOS;C:\WINDOWS
                    after  -  PATH C:\DOS;C:\WINDOWS;C:\FIX
                 If your AUTOEXEC.BAT file has no PATH statement, use
                 the editor to insert one.  Example:  PATH C:\FIX
                 
                 Including the FIX directory in your computer's search
                 path will enable you to run FIX from any directory on
                 any disk drive on your computer.
                 
             (7) Install FIX as a new program item in Windows.
                   a. Run Windows - open the Program Manager's window.
                   b. Open the Program Group to contain the FIX icon.
                   c. Click on the Program Manager's "File" option,
                      click on the "New" option, and select the
                      "Program Item" option - a form will pop up.
                   d. Enter information in ONLY the "Command Line"
                      blank field, and (optionally) the Shortcut Key
                      blank in the form.  Example:
                          Description:
                          Command Line:  C:\FIX\FIXWIN.PIF
                          Working Dir:
                          Shortcut Key:  Ctrl - Alt - F
                   e. Click on <OK> and an icon for FIX will appear
                      in the open Program Group window.
                 Double click on the FIX icon, or (optionally) press
                 the <Ctrl><Alt><F> keys simultaneously, to open a DOS
                 window in which to run FIX.
                 
            























::
