home *** CD-ROM | disk | FTP | other *** search
/ PC Open 7 / pcopen7.iso / MSDOS / Fill702 / BRUCEINI.DOC < prev    next >
Encoding:
Text File  |  1997-02-09  |  8.2 KB  |  202 lines

  1. BRUCEINI.DOC                        1                         Revised: 02-09-97
  2.  
  3. This text file describes what INI files are and how they are supported by  this
  4. program and other programs by the same author.  INI files are  always  optional
  5. but they can be very useful.
  6.  
  7. An INI file is a way of specifying parameters for a program that you don't want
  8. to have to respecify from the command line  each  time.   This  allows  you  to
  9. override any program defaults you want to change.
  10.  
  11. This is very useful if you disagree with the defaults I've established for  the
  12. routines.  It is also useful in cases where you typically use the  command  one
  13. way but in fairly regular cases you need to run the command using a whole bunch
  14. of different parameters.  You can set up one INI file for your  standard  usage
  15. and then provide a different INI file when it's time to  run  the  lesser  used
  16. versions.
  17.  
  18. Each of the programs reads an INI file if it can find one.  By default, the INI
  19. file that is searched for is based on the executable's  name  but  not  always.
  20. This is  shown  below  (block  declarations  and  environmental  variables  are
  21. described later):
  22.  
  23.         Routine         INI file        Block           Env variable
  24.  
  25.         AV.EXE          AV.INI          [AV]            AV
  26.         BFIND.EXE       BFIND.INI       [BFIND]         BFIND
  27.         CHANGE.EXE      CHANGE.INI      [CHANGE]        CHANGE
  28.         CONVERT.EXE     CONVERT.INI     [CONVERT]       CONVERT
  29.         COPSINCE.EXE    COPSINCE.INI    [COPSINCE]      COPSINCE
  30.         DATES.EXE       DATES.INI       [DATES]         DATES
  31.         DIRCOMP.EXE     DIRCOMP.INI     [DIRCOMP]       DIRCOMP
  32.         DIRTOTAL.EXE    DIRTOTAL.INI    [DIRTOTAL]      DIRTOTAL
  33.         EUMAIL.EXE      EUMAIL.INI      [EUMAIL]        EUMAIL
  34.         FILL.EXE        FILL.INI        [FILL]          FILL
  35.         FILUPDAT.EXE    FILUPDAT.INI    [FILUPDAT]      FILUPDAT
  36.         FIXTEXT.EXE     FIXTEXT.INI     [FIXTEXT]       FIXTEXT
  37.         FORTUNE.EXE     FORTUNE.INI     [FORTUNE]       FORTUNE
  38.         HTMSTRIP.EXE    HTMSTRIP.INI    [HTMSTRIP]      HTMSTRIP
  39.         ISAMFIND.EXE &
  40.           ISAMMAKE.EXE  ISAMFIND.INI    [ISAMFIND]      ISAMFIND
  41.         MOZ.EXE         MOZ.INI         [MOZ]           MOZ
  42.         PAGINATE.EXE    PAGINATE.INI    [PAGINATE]      PAGINATE
  43.         READ.EXE &
  44.           READINIT.EXE &
  45.           READMAKE.EXE &
  46.           READY.EXE     READ.INI        [READ]          READ
  47.         TXTABLE.EXE     TXTABLE.INI     [TXTABLE]       TXTABLE
  48.  
  49. The INI file is an ASCII text file that can be created maintained by hand.  The
  50. commands in the INI file should begin in column 1.  It can consist of:
  51.  
  52.   (a) Command-line parameters
  53.   (b) Comments
  54.   (c) Block declarations
  55.   (d) Special items (vary by routine)
  56.  
  57.  
  58. BRUCEINI.DOC                        2                         Revised: 02-09-97
  59.  
  60. (a)  Command-line parameters:  The INI file can consist or one or more  command
  61.      line parameters.  In most  cases,  it  can  *only*  include  command  line
  62.      parameters that begin with a slash ("/").  These will vary by  routine  of
  63.      course but, in READ for example, your INI file might appear like this:
  64.  
  65.         /MONO
  66.         /-DOS
  67.         /COLOR=123 134 145 156
  68.  
  69. (b)  Comments:  The INI file can also contain comment lines.  These are defined
  70.      as any lines that are either blank or begin with a  semi-colon  in  column
  71.      one.
  72.  
  73. (c)  Block declarations:  You can combine INI files if you'd like.  This  saves
  74.      some disk space.  Typically, this is  done  in  connection  with  the  SET
  75.      BG=inifile environmental parameter (described below).  Blocks are declared
  76.      by using the name of searched-for routine in  brackets.   (See  the  table
  77.      above to  see  what  blocks  are  searched  for  for  each  routine.)  Any
  78.      statements between one block and the next are  assumed  to  be  associated
  79.      with the first routine.  For example:
  80.  
  81.         ; ALL.INI -- contains all of the INI statements
  82.         [DATES]
  83.         /SORT
  84.         [FILL]
  85.         /ON
  86.         /SPLIT
  87.         [READ]
  88.         /MONO
  89.  
  90. (d)  Special items:  Some routines allow the INI  file  to  include  statements
  91.      that cannot be specified from the command line.  These special  statements
  92.      are described in the specific routine's documentation.
  93.  
  94. A    fairly complicated example might be an INI  file  used  for  the  HTMSTRIP
  95.      program.  In this case, you might find  all  of  the  following  types  of
  96.      lines:
  97.  
  98. (blank line)   ignored as comment
  99. ;xxxxx ignored as comment
  100. [xxxxx] beginning of program block (e.g. "[HTMSTRIP]")
  101. /xxxxx command-line parameters
  102. \xxx = \xxx    character-translation entry
  103. &xxx;= xxx     entity references (HTML translations)
  104. <xxx> = xxx    how to show certain blocks
  105.  
  106.  
  107. BRUCEINI.DOC                        3                         Revised: 02-09-97
  108.  
  109. Where does each program look for the INI file?
  110.  
  111. Each program here looks for an INI file unless instructed otherwise.  The logic
  112. used is as follows.  Note that the first "hit" wins:
  113.  
  114. (a)  No INI file is checked for if any of the following is true:
  115.       - /-I or /INULL is passed in from the command line
  116.       - /-I or /INULL is passed in from the routine's environmental parameter
  117.            (for example, SET READ=/-I)
  118.       - the environmental variable BG is set to the value of /-I or /INULL
  119.            (for example, SET BG=/-I)
  120.      Most programs accept either /-I  or  /INULL.   However,  several  routines
  121.      (BFIND and CHANGE) accept /-I to mean do a case-insensitive  search.   For
  122.      these programs, you *have* to use /INULL instead.
  123.  
  124. (b)  If a /Iinitfile setting is passed in, the routine uses this  to  determine
  125.      the name of the INI file to look  for.   Note  that  the  file  name  must
  126.      include a period (for example, "/ICHANGE.INI") or the  program  will  skip
  127.      it.
  128.  
  129. (c)  The routine looks for an environmental variable BG.  If this  variable  is
  130.      defined (and it's not set to /-I), then the routine takes this to  be  the
  131.      name of the INI file to look for.
  132.  
  133. (d)  The routine looks for the INI file under the "INI file" name shown in  the
  134.      table at the start of this documentation.
  135.  
  136. If the INI file name does not include either a drive or path specification (for
  137. example, you don't pass in  something  like  /IC:\ALL.INI),  the  routine  will
  138. search for the named file.  It will check for it in the following places in the
  139. following order.  The first place that it finds it wins:
  140.  
  141.   - Your default subdirectory (where you were when you executed the command)
  142.   - The subdirectory that contains the EXE that you're executing
  143.   - Your regular DOS path
  144.  
  145. If you do not have an INI file, this searching can take  awhile  especially  if
  146. you have any networked drives in your path.  In  this  case,  specifying  "/-I"
  147. will save some time.  Passing in a fully qualified filename also helps.
  148.  
  149.  
  150. BRUCEINI.DOC                        4                         Revised: 02-09-97
  151.  
  152. Personally, I have a common INI file named WAYNE.INI  in  the  root  of  my  C:
  153. drive.  I put it there so I don't run out of environmental space by  specifying
  154. some huge path.  I have the following statement in my AUTOEXEC.BAT:
  155.  
  156.      SET BG=C:\WAYNE.INI
  157.  
  158. Currently, my C:\WAYNE.INI file looks like this:
  159.  
  160.      [AV]
  161.      /on
  162.      [bfind]
  163.      /-empty
  164.      [COPSINCE]
  165.      /def text=*.bas *.bi *.c *.diz *.doc *.h *.ref *.sas *.sc *.txt
  166.      /def prg=*.bas *.bat *.bi *.c *.h *.sas
  167.      /to c:\temp
  168.      /replace
  169.      /-beep
  170.      /text
  171.      /copy -0
  172.      [DATES]
  173.      /cc:\mine\datemine.txt
  174.      /sort
  175.      /day
  176.      /-i
  177.      [FILL]
  178.      /letter
  179.      [htmstrip]
  180.      /lc:\vbdos\htmstrip.ini
  181.      /-symbols
  182.      /warnings
  183.      [paginate]
  184.      /overwrite
  185.      /cc:\bat\brucedoc.ctl
  186.      [txtable]
  187.      /debug
  188.  
  189. If I ever need to override the WAYNE.INI settings, it's easy to do  by  passing
  190. them in from the command line or by specifying /-I from the command line.
  191.  
  192.  
  193.                 Bruce Guthrie
  194.                 Wayne Software
  195.                 113 Sheffield St.
  196.                 Silver Spring, MD 20910
  197.  
  198.                 fax: (301) 588-8986
  199.                 e-mail: bguthrie@nmaa.org
  200.                 http://www.geocities.com/SiliconValley/Lakes/2414
  201. 
  202.