


dFIXUP 3.8_____________________________________________________ February 5, 1989


            NAME:     DFIXUP.EXE
            
            PURPOSE:  Processes standard dBASE1-type program files,
                      and writes properly indented output files. In
                      addition,  dFIXUP   detects  and  reports  on
                      programming mistakes,  and displays some file
                      statistics.
            
            SYNTAX:   DFIXUP [filespec1 ... filespecN]
            
                      filespec can be one of the following:
            
                           The name  of a  .PRG file, with optional
                           .PRG extension.
                           
                           The name  of a  .CLP file  (used by  the
                           Clipper2 compiler),  with optional  .CLP
                           extension.  All   .CLP  files   must  be
                           prefixed   with   an   '@',   which   is
                           consistent with  the syntax  used by the
                           Clipper compiler. .CLP files contain the
                           names of  files  to  be  processed,  one
                           filename per  line, with  optional  .PRG
                           file extension.
                           
                      The dFIXUP  command line  supports both  path
                      names and wildcards.
                      
                      If  no  command  line  arguments  are  given,
                      dFIXUP will  prompt you  for an input file to
                      be processed.
                      
                      For files  not prefixed  with an  '@', dFIXUP
                      will  automatically   assume  a   .PRG   file
                      extension. For  all files  prefixed  with  an
                      '@', a .CLP extension is assumed. If you have
                      a file  (either  .CLP  or  .PRG)  without  an
                      extension, you  can process it by including a
                      period after  the filename,  e.g. in  essence
                      saying that the file extension is blank.
                      
                      
            USAGE:    dFIXUP will  write all  .PRG files  specified
                      into files  with the  same basename, but with
                      an .OUT extension. The following are examples
                      of some input file names, and their resulting
                      output file names:
            
                           PAYROLL        PAYROLL.OUT
                           SAMPLE.PRG     SAMPLE.OUT
                           C:\DBASE\TEST  C:\DBASE\TEST.OUT
            ____________________
            1    dBASE is a registered trademark of Ashton-Tate
            2    Clipper is a registered trademark of Nantucket



User's Guide ____________________________________________________________ Page 1





dFIXUP 3.8_____________________________________________________ February 5, 1989


            
                      All  specified  files  will  be  indented  as
                      required, and comments will not be removed.
            
                      If you do not specify one or more files to be
                      processed on  the command  line, dFIXUP  will
                      ask you for the name of a single .PRG file to
                      be processed.  In this interactive mode, both
                      path names  and  .CLP  files  are  supported,
                      while wildcards are not.
            
                      In addition  to the input file name, you will
                      also be  asked to  supply an output file name
                      (which must be different from the input file;
                      if this  is not the case, the input file will
                      be destroyed),  as well  as whether to indent
                      the file  and whether  or not  to remove  all
                      comment lines.
            
                      If you  press ENTER  without  a  filename  in
                      response to  the output  file prompt,  dFIXUP
                      will assume  the basename  of the  input file
                      with an .OUT extension.
            
                      If  you   answer  'N'  to  the  prompt  about
                      indenting, dFIXUP will remove all indentation
                      from the  output file  specified. This can be
                      useful after  development  is  complete,  and
                      disk space is tight.
            
                      If  you   answer  'Y'  to  the  prompt  about
                      indenting, or  if you  process files from the
                      command line, dFIXUP will prefix each line of
                      your program  with three spaces each for each
                      level  of   indentation.  This  is  also  the
                      default if  you press  ENTER in  response  to
                      this prompt.
            
                      If  you   answer  'Y'  to  the  prompt  about
                      removing comments,  dFIXUP  will  remove  all
                      lines that start with a single asterisk ('*')
                      or the  keyword NOTE.  dFIXUP will not remove
                      comment lines  starting with  two  ampersands
                      ('&'). Pressing  ENTER in  response  to  this
                      prompt is equivalent to pressing 'N'.
            











User's Guide ____________________________________________________________ Page 2





dFIXUP 3.8_____________________________________________________ February 5, 1989


            ERRORS:   dFIXUP will  detect the  following  kinds  of
                      errors:
            
                      Mismatched statements:
            
                           IF - ELSE - ELSEIF - ENDIF
                           DO WHILE - ENDDO
                           DO CASE - CASE - OTHERWISE - ENDCASE
                           FOR - NEXT
                           
                           Example:
                           
                                DO WHILE .T.
                                   DO MAINMENU
                                ENDIF
                           
                      Unbalanced statements:
                      
                           IF - ENDIF
                           DO WHILE - ENDDO
                           DO CASE - ENDCASE
                           FOR - NEXT
                           
                           Example:
                           
                                IF AT(ANSWER,'YyNn') > 0
                                   IF UPPER(ANSWER) = 'Y'
                                      ...
                                   ELSE
                                      ...
                                   ENDIF
                                   ...
                                   ...
                                
                                <EOF>
                      
                      Extra statements:
                      
                           ELSE
                           OTHERWISE
                           
                           Example:
                                
                                IF upper(STATE) = 'CA'
                                   ...
                                ELSE
                                   ...
                                ELSE
                                   ...
                                ENDIF
                      
                      If any errors are found during the processing
                      of a  file,  dFIXUP  will  display  the  file




User's Guide ____________________________________________________________ Page 3





dFIXUP 3.8_____________________________________________________ February 5, 1989


                      statistics, and  then wait  until you press a
                      key.
                                
            EXAMPLE:  Command line use of dFIXUP:
                      
                           DFIXUP PAYROLL.PRG
                           DFIXUP AR*.PRG AP*.PRG
                           DFIXUP @GL.CLP
                           DFIXUP *.PRG
                           
                      Interactive use of dFIXUP:
                           
                           DFIXUP
                                
            BATCH FILES:
                      dFIXUP will  set the  DOS  ERRORLEVEL  if  it
                      terminates with  an  error  condition.  These
                      errors and the corresponding exit codes are:
            
                      Couldn't open input file                1
                      Couldn't open output file               2
                      Error writing output file               3
                      dFIXUP aborted by user                  6
                      Couldn't install interrupt handler      7
                      Couldn't allocate memory for file list  8
                      Couldn't open .CLP file                 9
            
            
                      dFIXUP will try to diagnose and explain these
                      errors if possible.
            
                      You can  test against these exit code using a
                      IF   ERRORLEVEL   <n>   statement   in   your
                      batchfiles.
            
            SPECS:    dFIXUP   has   the   following   limitations,
                      requirements and specifications:
            
                      DOS version:             MS/PC-DOS 2.0 or
                                               higher
                      Program file length:     Unlimited
                      Indentation levels:      64 levels
                      Files per run:           256 files
                      File path length:        40 characters
                      Memory requirements:     23KB plus up to 41
                                               bytes for each file
                                               processed.
                      Program line length:     254 characters, as
                                               in dBASE III
                      File size:               17313 bytes
                      File date & time:        1-30-89, 4:51pm
                      
                      If the file you receive is different in size,
                      or has a different date stamp, do not use the



User's Guide ____________________________________________________________ Page 4





dFIXUP 3.8_____________________________________________________ February 5, 1989


                      program. It may be a Trojan Horse or infected
                      with a Virus.
                      
                      dFIXUP was  implemented  using  Microsoft  C3
                      Version 5.1,  using the  standard  C  runtime
                      library.
            
            COMMENTS: dFIXUP 3.8 is essentially the same as version
                      3.7,  with   added  support  for  the  ELSEIF
                      command found  in Clipper.  Furthermore,  the
                      user interface  was beefed  up a  little,  by
                      displaying the  default actions  being  taken
                      when pressing ENTER.
            
                      I  also   improved  the   statement  matching
                      algorithm to  more closely  resemble dBASE's,
                      e.g. at  least four  letters are significant,
                      but more will be checked if supplied.
            
                      Furthermore,  I  removed  the  internal  file
                      caching provided  in earlier  versions.  This
                      was done  after  I  found  that  it  actually
                      slowed systems  with a  hard disk  down  (how
                      embarrassing). The  down side  is that dFIXUP
                      now runs  about twice as slow if reading from
                      or writing to floppy.
            
                      dFIXUP 3.7  fixed a bug found in version 3.6,
                      which caused mismatched control structures to
                      be reported  if a  line in  a TEXT  - ENDTEXT
                      structure  started  with  a  valid  dBASE  or
                      Clipper control structure. The following code
                      excerpt demonstrates this problem:
            
                           TEXT
                                If you're using dFIXUP 3.7 or later
                                this will work OK,
                                otherwise dFIXUP will complain!
                           ENDTEXT
            
                      Version 3.6 did get confused by the OTHERWISE
                      on the second line of the TEXT block.
            
                      All comments,  suggestions and contributions,
                      if any,  should be  directed to the program's
                      author:
            
                           Torsten Hoff
                           10777 Wilshire Boulevard, Apt. #10
                           Los Angeles, CA  90024
                           

            ____________________
            3    Microsoft C is a registered trademark of Microsoft



User's Guide ____________________________________________________________ Page 5





dFIXUP 3.8_____________________________________________________ February 5, 1989


                      The author hereby grants a limited license to
                      copy  and   distribute  dFIXUP  to  all  non-
                      commercial   users    under   the   following
                      conditions:
            
                           dFIXUP must be distributed in unmodified
                           form,    including    the    README.1ST,
                           DFIXUP.EXE, DFIXUP.TXT,  and  DFIXUP.PRN
                           files.
                           
                           No fee  may be  charged by  anyone for a
                           copy of dFIXUP.
                           
                           dFIXUP may not be distributed as part of
                           any commercial product.
                           
                      The  author  considers  this  product  to  be
                      shareware.   Any    contributions   will   be
                      appreciated.






































User's Guide ____________________________________________________________ Page 6


