                        AUTOEDIT.TXT
                       

                     16th September 1999

                     AUTOEDIT Version 1

The names autoedit.exe and safeedit.exe refer to the same program
but in different modes of operation. They are also referred to as
the program within this file (readme.text).

This file contains information and instructions for the program.

Warning careless or incorrect use of this program can corrupt data and files.
Therefore:
It is essential that this file be read, and understood, completely
(especially the disclaimer and essential information at the end of this file)
before you start using the program.



Index

-1-     Shareware

-2-     About the program
        -2.1- History
        -2.2- The basics (Getting Started)
              -2.2.1- Introduction
              -2.2.2- ALL.BAT, ALL.CMD and TEST.INF
              -2.2.3- CONVERT.INF
        -2.3- OS2 Ini Files

-3-     Command Line Arguments

-4-     Disclaimer and essential information




                           -1-

                         Shareware
                        

I have been using predecessors of this program since my last Christmas
holidays and I wish that I had written it six or seven years back
as it would have saved a lot of frustration and time.

If you choose to try the program and intend to continue using it
because you find it useful, then the shareware price is $25 Australian
to the copyright owner:

                        R.McGuiness

                        51 Lord Street

                        Sandy Bay

                        Tasmania

                        Australia 7005


Please send your name and address along with your payment so that
you can be placed on a registered users list. If you register for one
version of this program then you are automatically registered for any
future versions i.e. you can download future versions and and use them
without registering again.

I am currently working on a PM interface to make setting up easier.
It will probably be early January 2000 before I have time to finish it.
I will make this available to registered users so I will need an email
address to send it to.

This program is not disabled in any way.

If you choose not to try or use this program then I suggest that you
remove it, and all copies of it, off your computer as careless or improper
use can cause corruption of files and data.

                           -2-

                      About the Program
                     


                           -2.1-

                           History
                          

You can skip this history bit if you like.

I have used OS2 since version 2.0 and have found changing winos2 settings
a constant hassle. My current machine is a 486 DX50 with
a trident video card.

I initially used several system.ini and win.ini files and swapped them,
at first manually, then later by bat files then a program. The idea was to
copy the basic ini file to a temp file at the start of the session then
back at the end of the session.

This mostly worked but if I overwrote the wrong file, or forgot to update
them all after installing a new program it got quite frustrating. The worst
problem occured when winos2 crashed on startup and I forgot to reset the
basic ini file before launching again.

Also, I was limited to using one set of settings at a time.

I started playing with adjusting the ini files themselves around
last Christmas. It became more important when my young boy to want
to use some preschool CD's and I needed to have several full screen session
running at the same time.

There is more to the history but there is no point rambling on forever.

                           -2.2-

                  The Basics (Getting Started)
                 

                           -2.2.1-

                        Introduction
                       

This program overcomes the problems, mentioned in the history section
by updating the system.ini or win.ini file automatically when
the session starts.

The program is mainly intended for full screen winos2 sessions.

Place the call to auto edit in autoexec.bat for you prefered options, then
create other autoexecs for other options. I keep mine in a directory
called autoexec.win. (A good thing that OS2 allows you a lot of frredom with
autoexecs.)

Use the settings notebook to get to the Other DOS settings and
change DOS_AUTOEXEC to the autoexec file containing the options you need.


If you are using windowed winos2 sessions then OS2 dictates some
settings so some of your intended changes may be ignored. Also
If you are not using seperate sessions then the initial winos2
settings will be used. This has not been a problem for me as I prefer
to use the full screen sessions.


The best way to use autoedit is to create a directory and
place the autoedit files in that directory.

The program is supplied with the name safeedit.exe.
The program checks for this name. If it is found it will automatically
make a unique backup of the ini file in the same directory as safeedit.exe
with the name tmp1.$$$, tmp2.$$$ etc.

It is essential that you make a backup of any file
you use with this program as you may need to revert to the backup file
if the changes you make do not work.

When testing I find that it is best to work on a copy of the ini file in a
different directory. I place the copy in the autoedit directory and
test it there.

Use the name safeedit.exe until you have everything working correctly
as it uses the system call copy to copy the ini file to the temporary
file name every time you use it. You can always delete the temporary files
later but that is better than trying to reconstruct an ini file.

                         -2.2.2-

                ALL.BAT, ALL.CMD and TEST.INF
               

To make explaining the program easier I have included
13 files for the DOS version:


ALL     .BAT
BASIC   .BAT
CESE    .EXE
CONVERT .INF
CONVERT .INI
DEMO    .INI
DEMO    .OLD
EXTEND  .BAT
FILES   .BAT
INSERT  .FLE
SAFEEDIT.EXE
TEST    .INF
TEST    .INI
UPTOG   .FLE

and 14 files for the OS2 version.

ALL     .CMD
BASIC   .CMD
CONVERT .INF
CONVERT .INI
DEMO    .INI
DEMO    .OLD
EPMTST  .INI
EXTEND  .CMD
FILES   .CMD
INSERT  .FLE
MARG    .DAT
SAFEEDIT.EXE
TEST    .INF
TEST    .INI
UPTOG   .FLE


By running all.cmd nder OS2 (or all.bat under DOS)
the directory will contain

ADDBETWN.DAT
ADDEND  .DAT
ADDIT   .DAT
ADDSTART.DAT
ALL     .CMD
BASIC   .CMD
BASIC   .OUT
COM800  .DAT
COMMAN  .DAT
COMPROG .DAT
CONVERT .INF
CONVERT .INI
DELBETWN.DAT
DELEND  .DAT
DELOCATE.DAT
DELPTEND.DAT
DELSTART.DAT
DEMO    .INI
DEMO    .OLD
EPMTST  .INI
EXTEND  .CMD
EXTEND  .OUT
FILES   .CMD
FILES   .OUT
FIRST   .DAT
HOLEPART.DAT
IGNOREIT.DAT
INSERT  .FLE
INSERTIT.DAT
LOCATEIT.DAT
MANAGER .DAT
MARG    .DAT
NOEOFI  .DAT
NOEOFR  .DAT
ONECHAR .DAT
OS2VID  .DAT
REMOVEIT.DAT
REPLACEC.DAT
REPLACEG.DAT
REPLACES.DAT
SAFEEDIT.EXE
TEST    .INF
TEST    .INI
UPTOG   .FLE




The file OS2VID.DAT is the default file to record the last arguments used
to start the program.

The default file name for the file that contains the calls is OS2VID.INI

The default file name for the file to be edited is SYSTEM.INI

These three files need to be in the current directory.

Calls need to go last on the command line. These are case sensitive
names given to the edit profiles in the OS2VID.INI file (or equivalent file).
They have the form

call:::
...
call###

Only the name is placed on the command line eg call.
(see -3-  Command Line Arguments and test.inf for more information.)


An explanation of the keywords used to generate the new files is
given in test.inf.

Test.inf is a commented copy of test.ini.

The calls made (and keywords used) by BASIC.BAT are all that are required to
manipulate win.ini or system.ini. They are made in the same order as
they appear in test.ini and test.inf.

By reading through the test.inf file up to the end of the BASIC.BAT section
and by comparing the changes made to the demo.ini and subsequent files
you should be able to use these keywords.

system:::
comment:::
comment
endcomment
uncomment
enduncomment
times
end
endend
replace
all
endreplace


By reading through the test.inf file up to the end of the EXTEND.BAT section
and by comparing the changes made to the demo.ini and subsequent files
you should also be able to use these keywords. These are extension that
give you alternative methods or more manipulative power over files.

start
endstart
whole
part
delstart
delend
enddel
addend
partend
endadd





By reading through the test.inf file up to the end of the FILES.BAT section
and by comparing the changes made to the demo.ini and subsequent files
you should be able to use these keywords which allows information to
stored in files. This may be necessary if you have a characters that
you editor wont save to file or several carriage returns in the data.

insertfile
removefile
location
noeof


NOTE:: Use test.inf as a guide to the syntax and usage of these keywords.
       I have tried to give an example of everything.

       Keywords are not case sensitive but calls are.


                           -2.2.3-

                         CONVERT.INF
                        

This file explains haw to convert the carriage returns of text files to
another format.

The keywords used are

replace
convert
null
endreplace

Convert will only work with the return characters \r, \n and \r\n.
Null is use to remove all the occurrences of the character.

CONVERT.INI is supplied for use but the command line options -s and
possiblly -r need to be used.




                           -2.3-

                        OS2 Ini Files
                       


The OS2 Version is enhanced so that it can modify OS2 ini files.
These files require calls to the OS2 profile functions.
If the DOS version or the NON os2 profile calls of the OS2 version
are used then the ini file will be corrupted.

Obviously you should backup and test any changes you intend to make.

The OS2 profile keywords are:
profile=
profilestring
profiledata
profilefile
endprofile

An example of how to use these keywords is given in EPMTST.INF and
EPMTST.INI. This has calls to change the size of the margins in IBM's
Enhanced Editor (epm.exe). (Make a backup of epm.ini first)

To work successfully with OS2 ini files you will need an
OS2 ini file editor so that you can determine the
application name
keyword name
type of data

profile=system profiles only    //allows the OS2 system profiles to be edited
profile=path                    //allows the ini file path to be edited
                                //eg profile=d:\os2\epm.ini

Note: Do not put spaces around the = sign.


The calls follow this format

string:::            //call's name
profilestring        //autoedit keyword
EPM                  //application name from inifile
MARGINS              //keyword name from inifile
1 79 1               //data to be used
 ...                 //application, keyword,data combinations

endprofile           //end current profile change type (required)
profiledata          //autoedit keyword
 ...                 //application, keyword,data combinations
endprofile           //end current profile change type (required)
profilefile          //autoedit keyword
 ...                 //application, keyword,file name combinations
endprofile           //end current profile change type (required)
string###





There are two types of data:

a)    null terminated
      use profilestring

b)    not null terminated
      profiledata
      profilefile

Using the wrong keyword will cause problems, possibly destroy the ini file,
so you need to test first.

Remember to make a backup first and to use safeedit.exe.

NOTE:    Depending upon the program you may find that any changes that
         you make to an ini file, for a program that is running, will
         take effect immediately for every session of that program that is
         concurrently running. So if you start a second session you may
         find that the setting for the first setting has changed to
         the settings that you started the second session with.
         (This is probably true for most programs).


                           -3-


                      Command Line Arguments
                   

Usage:

safeedit.exe [options] calls

autoedit.exe [options] calls


All arguments require spaces between them.

If an argument requires a file name, or quantity, then there must
be a space between them.

All arguments start with -

Arguments can be in any order or case except the calls.

Calls need to go last on the command line. These are case sensitive
names given to the edit profiles in the OS2VID.INI file (or equivalent file).
They have the form

call:::
...
call###

Only the name is placed on the command line eg call


Give full paths to files that are not in the current directory.


Options:


-b filename        Makes a backup of the file to be edited. The
                   name of the backup file is given by filename.

-c filename        Makes a file that contains the changes to the
                   edited file. This was used a diagnostic tool.
                   The changes are in location order within the original
                   file to be edited.

                   The information given is:
                   Change number
                   Start location
                   End location
                   Length of data
                   Data

-d filename        This allows an alternative file to be used to the
                   default os2vid.dat file that records the command line
                   arguments that were last used.

-e character       Allows the end of file character to be changed.
                   Reads in only the first character.

-i filename        This allows an alternative file to be used to the
                   default os2vid.ini file that contains the information
                   used (calls, keywords etc) to edit a file

-m integer         The default array length is 128 characters. This allows
                   you to increase the value if you need to insert a very
                   long line eg for 1000 characters use -m 1000

-o                 This allows you to override the last usage check and forces
                   the program to process the calls.

-r filename        This allows you to redirect the output to a file and
                   leave the original file to be edited unchanged.

-s filename        This allows you to specify the file to be edited on
                   the command line. It overrides the default and system:::
                   options.

-t                 This causes the program to generate a temporary backup
                   file in the current directory.
                   They follow the form tmp1.$$$, tmp2.$$$ etc.
                   A new temporary file is generated on every start up of
                   autoedit.exe.

                   Safeedit.exe has the -t option permanently switched on.



                           -4-


                ESSENTIAL INFORMATION & DISCLAIMER
               


     *****Please read the following essential information carefully.*****


                       ESSENTIAL INFORMATION
                      


     ͻ
                                                                      
       Read this autoedit.txt file completely before using the        
       program.                                                       
                                                                      
       Make sure that you fully understand how to use                 
       autoedit.exe (safeedit.exe) before using the program.          
                                                                      
       This program is intended for modifying the system.ini and      
       win.ini files used for winos2 full screen sessions.            
       Only the OS2 version using the OS2 profile keywords can be     
       used to modify OS2 ini files.                                  
                                                                      
       You must keep a backup of the system.ini, win.ini or os2 ini   
       files so that you can revert to these if you do someting wrong.
                                                                      
       I have placed as many safeguards into                          
       autoedit.exe (safeedit.exe) as I can                           
       and you are expected to use them until you have ensured        
       that autoedit.exe (safeedit.exe) is functioning correctly      
       with your files.                                               
                                                                      
       Do not change the name of the file from safeedit.exe to        
       autoedit.exe until you have everything working correctly.      
                                                                      
       Autoedit.exe (safeedit.exe) is capable of modifying any file   
       that it can fit into memory but only if you instruct it to     
       load the file and provide the data for modification.           
                                                                      
       Hence autoedit.exe (safeedit.exe) has the potential to         
       destroy vital files if used incorrectly or recklessly.         
                                                                      
       Again I state that you must make a backup of the files and     
       use the safeguards until you have ensured that everything is   
       correct.                                                       
                                                                      
     ͼ


     *****Please read the following disclaimer information carefully.*****


                       DISCLAIMER
                      

     ͻ
                                                                      
       I cannot make a warranty of any kind nor can I guarantee       
       that autoedit.exe (safeedit.exe) is completely bug free.       
                                                                      
       You use autoedit.exe (safeedit.exe) at your own risk.          
                                                                      
       You make the choice whether to use this program or not.        
       By using the autoedit.exe (safeedit.exe) program you accept    
       full responsibility for its use. You must use it               
       with care and maintain backups of any file that it is to       
       modify.                                                        
                                                                      
       As I have no control over how you use                          
       autoedit.exe (safeedit.exe), and you use it at your own risk,  
       I can accept no liability for any losses that may arise from   
       the use of autoedit.exe (safeedit.exe).                        
                                                                      
     ͼ


