home *** CD-ROM | disk | FTP | other *** search
-
- ByteX 5.0 (19940302)
-
- by Stephen D. Childers
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- --\ /-- *** WARNING !!! *** *** WARNING !!! ***
- (o) (o)
- ^ This program, if not used properly, can damage files. [ouch]
- \_____/
-
- Do not use this program on original files unless you know exactly what
- you are doing.
-
- This is the warning that should have been given with the first version of
- this program.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Program Description:
-
- 1) Program is used to alter TEXT or BINARY files.
-
- This program will take an input file and exchange an old word
- pattern for a new word pattern. All old word patterns in the file
- will be exchanged with the new word pattern. The format for the
- old word pattern and new word pattern may be as strings or
- hexadecimals.
-
- 2) Program will print out the total number of exchanges made.
-
- 3) Runs only from CLI. Can be made resident.
-
- 4) The [-options] argument can be placed in the 1st, 2nd or 3rd
- argument position of the command line; placing the [-options] in
- the 2nd argument position will allow this program to be used with
- the S:SPAT script file, thus allowing the use of wild characters.
-
- The following examples are for proper SPAT operation:
-
- ie > Execute SPAT Bytex *.c -o -s "DF0:" -s "RAM:"
- or > Execute SPAT Bytex in:here/#?.c out:there/ -c -s "DF0:" -s "RAM:"
-
- The following SPAT example will not work as expected:
-
- no > Execute SPAT Bytex -o #?.c -s "DF0:" -s "RAM:"
-
- IMPORTANT NOTE:
- The SPAT script file must be modified to receive 7 opts before it
- can accept the ByteX command line.
-
- 5) Program (when run from CLI) will now interact with the 'c:Why'
- command after program failures; this command may provide a more
- detailed explanation of why the program failed.
-
- The 'Why' command should be used immediately after a program
- failure to extract the last program's result code, because
- that result code is changed upon the execution of the next CLI
- command.
-
- 6) Certain error reports will contain the name of the argument, file,
- device, (etc) that is associated with failure when it occurs.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CLI usage:
-
- 1 > ByteX [!|?] [[-options] input [output] -opt1 word1 -opt2 word2]
-
- options c = Case insensitive exchange
- o = Overwrite input file
- 1 = Algorithm 1 (use maximum memory)
- 2 = Algorithm 2 (use minimum memory)
- q = Quiet; do not print messages
- ! = Show author info
-
- input = The input file; source
- output = The output file; destination
-
- opt1 or opt2; 'h' = word is in HEX format.
- 's' = word is in STRING format.
-
- word1 = the old word to replace.
- word2 = the new word that will replace word1.
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
-
- 1) The formats for words (word1 & word2) can be mixed. One word
- may be in the HEX format and the other in the STRING format.
-
- 2) Lengths allowed for argument word1 and word2 are restricted by the
- maximum limits imposed by the CLI.
-
- 3) When altering TEXT files it does not matter if the length of word1
- is not equal to the length of word2, but program will run slower.
-
- 4) Certain restrictions must be observed when altering BINARY program
- files. When altering binary program files you must insure that the
- old word (word1) and the new word (word2) are the same lengths or
- else the altered program file will most likely fail to run.
-
- 5) Option 'c' is for (c)ase insensitive exchanges. Under this
- option the case condition of the new word will be exchanged with
- the old word regardless of the case condition of the old word.
-
- 6) If the [out] (output file) arg is not given (and option -o is not
- selected) then the input file name will be used in creating the
- output file name, and that name will have the extension ".BX"
- appended to it.
-
- 7) Option -o does not require the output file argument, and program
- will ignore [out] arg if given.
-
- 8) Option -o requires algorithm #1 and will load all of the input
- file into memory, and if there is not enough memory the program
- will inform you to try again without option -o, thereby allowing
- algorithm #2 to be used.
-
- 9) Option -o will not overwrite inputfile unless the number of
- word pattern exchanges is greater than zero.
-
- 10) Options -1 & -2 allows user to choose the Read/Write algorithm that
- is needed for your system configuration.
-
- ByteX has 2 algorithms, and will automatically choose the algorithm
- that your system will allow, or you can force the algorithm of your
- choice. The algorithms are for Read/Write operations and are:
-
- -1 Algorithm #1 is the fast mode and attempts to put all of the
- input file into system memory when it is available, thus
- allowing faster Read/Write operations when working with files
- on any device (ie DF0:), thereby reducing drive clatter and
- gronking (alias: wear and tear) on drives.
-
- -2 Algorithm #2 is the slow mode and uses a small amount of system
- memory (regardless of inputfile size), this will cause drive
- gronking and clatter, unless the input file and output file are
- on different drives.
-
- To avoid the posibility of drive clatter when working on files
- greater than 10000 bytes then use option -1 which will force ByteX
- to fail if it is unable to get the memory needed for fast mode.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CLI Examples:
-
- 1> ByteX anytext newtext -h 0a -h 0a0d
-
- This example will take the inputfile 'anytext' and exchange all
- occurances of the hex value '0a' for the new hex value of '0a0d'.
- 0a = Line Feed (LF), 0d = Carriage Return (CR).
-
- NOTE: This comes in handy when capturing text files from different
- computer BBS services that use different line ending formats. You
- can now exchange the CR/LF control character combinations to
- whatever CR/LF combination suits your particular need.
-
- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- 2> ByteX -c dpaint -s df1: -s RAD: ; exchange string with string
- ByteX -c dpaint -h 6466313a -s RAD: ; exchange hex with string
- ByteX -c dpaint -s df1: -h 52414d3a ; exchange string with hex
- ByteX -c dpaint -h 6466313a -h 52414d3a ; exchange hex with hex
-
- All of the lines given in this example will accomplish the same
- thing; 'df1:' will be replaced with 'RAD:'.
-
- This example will take file 'dpaint' (Deluxe Paint V2.0) and take
- all the occurances of the string 'df1:' and exchange them with the
- 'ram:' string, and the default output file will named dpaint.BX
-
- NOTE: The reason I altered the dpaint (v2.0) program was because it
- would keep me from getting the file input window IF the df1: disk
- drive was empty. It may be a nice safety feature but I got tired of
- having to insert a diskette into df1: just so I could gain access to
- the file input window. I do art work in memory first and then save
- it to disk (unless the power goes out <smile>).
-
- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- 3> ByteX Comm Comm1 -s RAM: -s RAD:
-
- This example will replace the string 'RAM:' with 'RAD:' and
- the output file will be named as 'Comm1'.
- 'Comm' is a public domain communications program.
-
- NOTE: The reason I altered this program was because it would bring
- up a little window saying 'wrong diskette' if it could not find the
- 'RAM:' device available. I would rather use RAD.
-
- Please notice the case differences between this example and example
- #2; it is possible for a single program to have a device name in
- lower case and then have the same device name in upper case. In a
- case like this you would have to use the '-c' option in order to
- change all case differences of the device name.
- An imaginary example would be:
-
- 1> ByteX -c Comm Comm1 -s ram: -s RAD:
-
- This changes all case conditions of the word ram (Ram, RAM, etc).
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Furthermore:
-
- Another use for the "ByteX" program is to introduce ANSI escape code
- sequences into text files that have been created with Ed, or created
- by any text editor that can not imbed ANSI codes directly.
-
- If you would like to see what "ByteX" can do with a text file that is
- filled with unactivated ANSI codes ("unactivated" meaning = the
- required escape character is missing or waiting to be exchanged for
- another character) then copy files "ansitest.txt" and "ByteX" to
- your ram memory device and then type the following CLI commands
- within a full size CLI window:
-
- > ByteX ansitest.txt -h 405b -h 1b5b
- > type "ansitest.txt.BX"
-
- The "40" on the CLI line above is the hexadecimal number for the
- '@' symbol and "5b" is hexadecimal number for the '[' symbol.
- "1b" is hex for ESCAPE code.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Version History:
-
- The following information briefly describes changes or improvements
- made to each version, and they will be described in descending order;
- meaning latest version information begins first:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Version 5.0 (19940302) -
- 1) Changed version numbering format. Program can now be used with the
- "Version" command. Date within parenthesis is shown in a somewhat
- international format as (yyyymmdd).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Version 19930726 -
- 1) Optimized and refined source code thereby making program smaller.
- 2) Alas, removed a major programmer's error which occured when using
- option -c, this error would cause improper operation when using
- option -h (hex format -which is used when looking for non-printable
- words). This would happen when attempting to exchange hex words
- containing byte values above hex 7F (127 decimal).
- 3) Added "*** WARNING !!! ***" paragraph to beginning of doc file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Version 19920112 -
- 1) Removed a CLI parsing problem.
- 2) Removed problem which involved hex arguments.
- 3) Removed problem which involved pattern matching.
- 4) Can be made resident.
- 5) New option -o added for overwriting the input file with new data.
- 6) New options -1 and -2 added.
- 7) The [-options] argument can now be placed in 1st, 2nd or 3rd
- argument position of the command line which will allow program
- to be used with "s:spat" script file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Version 19910830 -
- 1) Runs faster.
- 2) New option 'c' for (c)ase insensitive exchanges.
- 3) No limit to length of hex words, except the length CLI allows.
- 4) The input word formats can be mixed, one word may be in hex format
- and the other word in string format.
- 5) Improved program error reporting.
- 6) Program (when run from CLI) will now interact with the 'c:Why'
- command after program failures.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Version 19910701 - The first version.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- / \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \
- / <_> <_> <_> <_> <_> <_> <_> \
- / \
- / 21 Death and life are in the power of the tongue: and \
- \ they that love it shall eat the fruit thereof. /
- / \
- \ The King James Holy Bible - Proverbs 18:21 /
- / \
- \ 35 A good man out of the good treasure of the heart /
- / bringeth forth good things: and an evil man out of the evil \
- \ treasure bringeth forth evil things. /
- / 36 But I say unto you, That every idle word that men shall \
- \ speak, they shall give account thereof in the day of judgment. /
- / 37 For by thy words thou shalt be justified, and by thy \
- \ words thou shalt be condemned. /
- / \
- \ The King James Holy Bible - Matthew 12:35-37 /
- \ _ _ _ _ _ _ _ /
- \ _ <_> _ <_> _ <_> _ <_> _ <_> _ <_> _ <_> _ /
- \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- End Of Document
-
-