home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / htmstrip.zip / BRUCEINI.DOC < prev    next >
Text File  |  1998-03-26  |  14KB  |  319 lines

  1. BRUCEINI.DOC                         1                         Mar 26, 1998
  2.  
  3. This text file describes using an *.INI file or environmental variables  to
  4. override the system defaults for  this  and  other  programs  by  the  same
  5. author.  Both of these are always optional but they can be very useful.
  6.  
  7. ---------------------------------------------------------------------------
  8.                                  INI files
  9. ---------------------------------------------------------------------------
  10.  
  11. 1.1 What is an INI file?
  12.  
  13.      An INI file is a way of specifying parameters for a program  that  you
  14.      don't want to have to respecify from the command line each time.  This
  15.      allows you to override any program defaults you want to change.
  16.  
  17.      This is very useful if you disagree with the defaults I've established
  18.      for the routines.  It is also useful in cases where you typically  use
  19.      the command one way but in fairly regular cases you need  to  run  the
  20.      command using a whole bunch of different parameters.  You can  set  up
  21.      one INI file for your standard usage and then provide a different  INI
  22.      file when it's time to run the lesser used versions.
  23.  
  24. 1.2 What's the default INI file name for each program?
  25.  
  26.      Each of the programs reads an  INI  file  if  it  can  find  one.   By
  27.      default,  the  INI  file  that  is  searched  for  is  based  on   the
  28.      executable's  name  but  not  always.   This  is  shown  below  (block
  29.      declarations are described in 1.3(c)  below;  environmental  variables
  30.      are described in section 2.1 below):
  31.  
  32.              Routine         INI file        Block           Environmental
  33.                                                              Variable
  34.  
  35.              AV.EXE          AV.INI          [AV]            AV
  36.              BFIND.EXE       BFIND.INI       [BFIND]         BFIND
  37.              CHANGE.EXE      CHANGE.INI      [CHANGE]        CHANGE
  38.              CONVERT.EXE     CONVERT.INI     [CONVERT]       CONVERT
  39.              COPSINCE.EXE    COPSINCE.INI    [COPSINCE]      COPSINCE
  40.              DATES.EXE       DATES.INI       [DATES]         DATES
  41.              DIRCOMP.EXE     DIRCOMP.INI     [DIRCOMP]       DIRCOMP
  42.              DIRTOTAL.EXE    DIRTOTAL.INI    [DIRTOTAL]      DIRTOTAL
  43.              EUMAIL.EXE      EUMAIL.INI      [EUMAIL]        EUMAIL
  44.              FILL.EXE        FILL.INI        [FILL]          FILL
  45.              FILUPDAT.EXE    FILUPDAT.INI    [FILUPDAT]      FILUPDAT
  46.              FIXTEXT.EXE     FIXTEXT.INI     [FIXTEXT]       FIXTEXT
  47.              FORTUNE.EXE     FORTUNE.INI     [FORTUNE]       FORTUNE
  48.              HTMSTRIP.EXE    HTMSTRIP.INI    [HTMSTRIP]      HTMSTRIP
  49.              ISAMFIND.EXE &
  50.                ISAMMAKE.EXE  ISAMFIND.INI    [ISAMFIND]      ISAMFIND
  51.              MOZ.EXE         MOZ.INI         [MOZ]           MOZ
  52.              PAGINATE.EXE    PAGINATE.INI    [PAGINATE]      PAGINATE
  53.              READ.EXE &
  54.                READINIT.EXE &
  55.                READMAKE.EXE &
  56.                READY.EXE     READ.INI        [READ]          READ
  57.              TXTABLE.EXE     TXTABLE.INI     [TXTABLE]       TXTABLE
  58.  
  59.  
  60. BRUCEINI.DOC                         2                         Mar 26, 1998
  61.  
  62. 1.3 What does an INI file look like?
  63.  
  64.      The INI file is an ASCII text file that can be created  maintained  by
  65.      hand. The commands in the INI file should begin in column 1.   It  can
  66.      consist of:
  67.  
  68.      (a) Command-line parameters
  69.      (b) Comments
  70.      (c) Block declarations
  71.      (d) Special items (vary by routine)
  72.  
  73.      (a)  Command-line parameters:  The INI file can consist or one or more
  74.           command line parameters.  In most cases, it  can  *only*  include
  75.           command line parameters that begin with  a  slash  ("/").   These
  76.           will vary by routine of course but, in READ for example, your INI
  77.           file might appear like this:
  78.  
  79.         /MONO
  80.         /-DOS
  81.         /COLOR=123 134 145 156
  82.  
  83.      (b)  Comments:  The INI file can also contain  comment  lines.   These
  84.           are defined  as  any  lines  that  are  blank  or  begin  with  a
  85.           semi-colon.
  86.  
  87.      Comments can also begin after a statement.  Precede them with at least
  88.           two spaces and a semi-color or one or more space  and  "/*"  like
  89.           the following:
  90.  
  91.         /MONO   ; Need to override color setting since upsets monitor
  92.         /-DOS   /* Don't want them being able to jump to DOS
  93.  
  94.      (c)  Block declarations:  You can combine INI  files  if  you'd  like.
  95.           This  saves  some  disk  space.   Typically,  this  is  done   in
  96.           connection  with  the  SET  BG=inifile  environmental   parameter
  97.           (described below).  Blocks are declared  by  using  the  name  of
  98.           searched-for routine in brackets.  (See the table  above  to  see
  99.           what blocks are searched for for each  routine.)  Any  statements
  100.           between one block and the next are assumed to be associated  with
  101.           the first routine.  For example:
  102.  
  103.              ; ALL.INI -- contains all of the INI statements
  104.              [DATES]
  105.              /SORT
  106.              [FILL]
  107.              /ON
  108.              /SPLIT
  109.              [READ]
  110.              /MONO
  111.  
  112.  
  113. BRUCEINI.DOC                         3                         Mar 26, 1998
  114.  
  115.      (d)  Special items:  Some routines  allow  the  INI  file  to  include
  116.           statements that cannot be specified from the command line.  These
  117.           special  statements  are  described  in  the  specific  routine's
  118.           documentation.
  119.  
  120.      A fairly complicated example  might  be  an  INI  file  used  for  the
  121.      HTMSTRIP program.  In this case, you might find all of  the  following
  122.      types of lines:
  123.  
  124.              (blank line)   ignored as comment
  125.              ;xxxxx         ignored as comment
  126.              [xxxxx]        beginning of program block (e.g. "[HTMSTRIP]")
  127.              /xxxxx         command-line parameters
  128.              \xxx = \xxx    character-translation entry
  129.              &xxx;= xxx     entity references (HTML translations)
  130.              <xxx> = xxx    how to show certain blocks
  131.  
  132. 1.4 Where does each program look for the INI file?
  133.  
  134.      Each program here looks for an INI file unless  instructed  otherwise.
  135.      The logic used is as follows.  Note that the first "hit" wins:
  136.  
  137.      (a)  No INI file is checked for if any of the following is true:
  138.  
  139.              - /-I or /INULL is passed in from the command line
  140.              - /-I or /INULL is passed in from the routine's  environmental
  141.                parameter (for example, SET READ=/-I)
  142.              - the environmental variable BG is set to the value of /-I  or
  143.                /INULL (for example, SET BG=/-I)
  144.  
  145.           Most programs accept either  /-I  or  /INULL.   However,  several
  146.           routines  (BFIND  and  CHANGE)  accept   /-I   to   mean   do   a
  147.           case-insensitive search.  For these programs, you *have*  to  use
  148.           /INULL instead.
  149.  
  150.      (b)  If a /Iinitfile setting is passed in, the routine  uses  this  to
  151.           determine the name of the INI file to look for.   Note  that  the
  152.           file name must include a period (for example, "/ICHANGE.INI")  or
  153.           the program will skip it.
  154.  
  155.      (c)  The routine looks for an  environmental  variable  BG.   If  this
  156.           variable is defined (and it's not set to /-I), then  the  routine
  157.           takes this to be the name of the INI file to look for.
  158.  
  159.      (d)  The routine looks for the INI file  under  the  "INI  file"  name
  160.           shown in the table at the start of this documentation.
  161.  
  162.  
  163. BRUCEINI.DOC                         4                         Mar 26, 1998
  164.  
  165. 1.5 What's the search path sequence for the INI file?
  166.  
  167.      If the INI  file  name  does  not  include  either  a  drive  or  path
  168.      specification  (for  example,  you  don't  pass  in   something   like
  169.      /IC:\ALL.INI), the routine will search for the named  file.   It  will
  170.      check for it in the following places  in  the  following  order.   The
  171.      first place that it finds it wins:
  172.  
  173.         - Your default subdirectory (where you were when you  executed  the
  174.           command)
  175.         - The subdirectory that contains the EXE that you're executing
  176.         - Your regular DOS path
  177.  
  178.      If you do not have  an  INI  file,  this  searching  can  take  awhile
  179.      especially if you have any networked drives in  your  path.   In  this
  180.      case, specifying "/-I" will  save  some  time.   Passing  in  a  fully
  181.      qualified filename also helps.
  182.  
  183. 1.6 I'm lost.  What does your INI file look like?
  184.  
  185.      Personally, I have a common INI file named WAYNE.INI in the root of my
  186.      C: drive.  I put it there so I don't run out of environmental space by
  187.      specifying some huge path.  I  have  the  following  statement  in  my
  188.      AUTOEXEC.BAT:
  189.  
  190.           SET BG=C:\WAYNE.INI
  191.  
  192.      Currently, my C:\WAYNE.INI file looks like this:
  193.  
  194.           [AV]
  195.           /on
  196.           [bfind]
  197.           /-empty
  198.           [COPSINCE]
  199.           /def text=*.bas *.bi *.c *.diz *.doc *.h *.ref *.sas *.sc *.txt
  200.           /def prg=*.bas *.bat *.bi *.c *.h *.sas
  201.           /to c:\temp
  202.           /replace
  203.           /text
  204.           /copy -0
  205.           [DATES]
  206.           /cc:\mine\datemine.txt
  207.           /sort
  208.           /day
  209.           /-i
  210.           [FILL]
  211.           /letter
  212.           [htmstrip]
  213.           /lc:\vbdos\htmstrip.ini
  214.           /-symbols
  215.           /warnings
  216.           [paginate]
  217.           /overwrite
  218.           /cc:\bat\brucedoc.ctl
  219.  
  220.      If I ever need to override the WAYNE.INI settings, it's easy to do  by
  221.      passing them in from the command line or by specifying  /-I  from  the
  222.      command line.
  223.  
  224. BRUCEINI.DOC                         5                         Mar 26, 1998
  225.  
  226. ---------------------------------------------------------------------------
  227.                        Using Environmental variables
  228. ---------------------------------------------------------------------------
  229.  
  230. 2.1 Introduction
  231.  
  232.      The programs all allow  you  to  pass  in  regular  DOS  environmental
  233.      variables, either from the command line or from the INI  file.   These
  234.      variables will be resolved by the program.  Under Windows 95 and 4DOS,
  235.      the variables are resolved by the operating system instead.
  236.  
  237. 2.2 What are environmental variables?
  238.  
  239.      The DOS environment is a shared  area  of  memory  that  is  used  for
  240.      setting certain values that one or more  program  might  need.   These
  241.      values are retrieved by examining a given environmental variable which
  242.      has specific information that a program might want.
  243.  
  244.      To see you environmental variables, type "SET" from the DOS prompt and
  245.      press <ENTER>.  This  will  return  a  listing  of  the  environmental
  246.      variables and their values.  For example:
  247.  
  248.         C:\>SET<ENTER>
  249.         CONFIG=NORMAL
  250.         BG=C:\WAYNE.INI
  251.         BLASTER=A220 I5 D1 H5 P320 Q2 T4
  252.         COMSPEC=C:\COMMAND.COM
  253.         CPAV=D:\PCT\DATA\CPAV.INI
  254.         CPBACKUP=D:\PCT\DATA
  255.         LINK=/SE:256
  256.         PATH=C:\DOS;C:\BAT;C:\;C:\UTIL;C:\UTIL\COPY;C:\UTIL\80386;C:\VBDOS;C:\UTIL\GRAPHICS;D:\PCT;E:\WINDOWS
  257.         PCTOOLS=D:\PCT\DATA
  258.         PROMPT=$p$g
  259.         TEMP=E:\TEMP
  260.         C:\>
  261.  
  262.      Environmental variables can be set by saying "SET variable=value" such
  263.      as:
  264.  
  265.         SET PROMPT=$p$g
  266.  
  267.  
  268. 2.3 Aren't there special environmental variables for these routines?
  269.  
  270.      (a)  Each routine has a default environmental variable that is checked
  271.           when the program runs.  See the table in section  1.2  above  for
  272.           more information about this.
  273.      (b)  Each routine also checks an environmental variable  BG  for  it's
  274.           value.
  275.  
  276.  
  277. BRUCEINI.DOC                         6                         Mar 26, 1998
  278.  
  279. 2.4 Other than the special ones above, how would you use  an  environmental
  280. variable in these routines?
  281.  
  282.      Pass in the variable as "%variable%" as part of the regular  parameter
  283.      list (or in the INI file or whatever) and the  programs  will  resolve
  284.      the variable to its assigned value for you.  For example:
  285.  
  286.              C:\>SET USER=BGuthrie
  287.              C:\>BFIND %USER% SYSTEM.INI
  288.  
  289.      Will cause the BFIND program to search for the string "BGuthrie"  when
  290.      it is run.  The routine leaves  intact  any  variables  that  are  not
  291.      defined.
  292.  
  293.      If you wish to turn off resolution  of  the  environmental  variables,
  294.      pass in the parameter /-ENV.
  295.  
  296. 2.5 Can I assign something with an equal sign in the value?
  297.  
  298.      Environmental variables can't contain equal signs since these are used
  299.      for the assignment itself.  If you need to use an equal  sign,  put  a
  300.      comma in instead and my programs will translate it as  an  equal  sign
  301.      for you.  This will not affect any comma within a quoted string.  Note
  302.      that this convention is not standard within DOS so it's only going  to
  303.      work in these specific programs.
  304.  
  305. ---------------------------------------------------------------------------
  306.                                   Author
  307. ---------------------------------------------------------------------------
  308.  
  309.                 Bruce Guthrie
  310.                 Wayne Software
  311.                 113 Sheffield St.
  312.                 Silver Spring, MD 20910
  313.  
  314.                 e-mail: WayneSof@erols.com   fax: (301) 588-8986
  315.                 http://www.geocities.com/SiliconValley/Lakes/2414
  316.              or find through http://www.erols.com/waynesof
  317.  
  318. 
  319.