home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / DB21.ZIP / DB.DOC next >
Encoding:
Text File  |  1988-04-24  |  19.2 KB  |  554 lines

  1.  
  2.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 1
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                 Table Of Contents
  9.                                 -----------------
  10.  
  11.  
  12.  
  13.  
  14.            TOPIC                                                  PAGE
  15.            -----                                                  ----
  16.  
  17.              Features and Overview ...............................  2
  18.  
  19.              Using DB ............................................  3
  20.  
  21.              Options
  22.                  C - Comments on Column One ......................  4
  23.                  d - Display .....................................  4
  24.                  h - Header ......................................  4
  25.                  l - List File ...................................  4
  26.                  o - Output File .................................  5
  27.                  s - Spaces ......................................  5
  28.                  t - Tab .........................................  5
  29.                  u - Untab .......................................  5
  30.                  U - Unbeautify ..................................  5
  31.                  v - Verbose .....................................  6
  32.                  w - No Error On Screen ..........................  6
  33.                  W - No Error In File ............................  6
  34.                  x - Shift Expression Continuation ...............  6
  35.  
  36.              Using RAMdisk .......................................  6
  37.  
  38.              Error Messages ......................................  7
  39.  
  40.              DB's History ........................................  8
  41.  
  42.              General Information .................................  9
  43.  
  44.              Acknowledgment ......................................  9
  45.  
  46.              Software License .................................... 10
  47.  
  48.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 2
  49.  
  50.  
  51.  
  52.      FEATURES
  53.  
  54.  
  55.      o General syntax checking
  56.  
  57.      o Indentation with tab or spaces
  58.  
  59.      o Creates .LST file
  60.  
  61.      o Generates .BAK file
  62.  
  63.      o Replaces dBASE III editor's wrap around character with ';'
  64.  
  65.      o On screen status displayed through Verbose mode
  66.  
  67.      o Option avialable to condense source file
  68.  
  69.      o RAMdisk support
  70.  
  71.  
  72.  
  73.      OVERVIEW
  74.  
  75.  
  76.      The  development  of  DBeautifier  was  inspired  by  CBeautifier, a C
  77.      program  beautifier,  in  the UNIX environment.  DB is also similar to
  78.      "Pretty",  for  those  who  program  in  PASCAL.   DB started out as a
  79.      simple  tool  to  help  me  understand the structure of my colleague's
  80.      codes using stdin and stdout.
  81.  
  82.      DBeautifier  organizes  the  structures  of  any dBASE/Clipper program
  83.      files, controlling the proper indentations of IF's, DO WHILE's, etc.
  84.  
  85.      Syntax  Error  Messages  are imbedded in the output file and displayed
  86.      on the CRT.  Options are available to disable Error Messages.
  87.  
  88.      DBeautifier  works  on .PRG files only, if extensions are not given DB
  89.      assumes  .PRG.    DB  renames  the  original  input  file  to .BAK and
  90.      generates  a  new .PRG.  Options like -d, -l and -o operates different
  91.      from those described above.
  92.  
  93.      The  dBASE  editor sometimes generate a wrap around character that can
  94.      not  be  seen.    This  wrap around character causes a Clipper compile
  95.      error.   DB will replace this character with a semicolon.  If the line
  96.      is a comment the wrap around character is replaced with a space.
  97.  
  98.      DB now supports the 4 character syntax.
  99.  
  100.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 3
  101.  
  102.  
  103.  
  104.      USING DB
  105.  
  106.  
  107.      Usage:   DB [Options] files...
  108.  
  109.  
  110.      Options  can  be  located  anywhere  on  the command line, and is Case
  111.      sensitive
  112.  
  113.             DB -W file1 -vt
  114.  
  115.      Command line switches must all take the form:
  116.  
  117.             -<character>[<number>|<string>]
  118.  
  119.      That  is,  all  arguments start with either a dash (-) or a slash (/).
  120.      Each  switch  is  identified  with  a  single  letter that immediately
  121.      follows  the  switchchar  (no  intervening spaces).  The letter may be
  122.      followed  by  an  optional  number  or  string,  again  with no spaces
  123.      between  the  identifying  character  and  the corresponding number or
  124.      string.    Switches  may be combined, if the argument types allow this
  125.      combination.  For example, the command line:
  126.  
  127.             DB -l -s20 -C file1 file2
  128.  
  129.      can also be given as:
  130.  
  131.             DB -ls20C file1 file2
  132.  
  133.      However,  if  a  string  is  expected  after the identifying character
  134.      (-o),  then  the  rest  of  the  argument is assumed to be part of the
  135.      string.    You  have  to be careful when combining string type command
  136.      line switches with other types.
  137.  
  138.      There  are  times when certain options are always desired.  Instead of
  139.      typing  these  options  every  time you are DBing, set the environment
  140.      variable DBFLAGS to contain your default options.
  141.  
  142.      Environment  variables  are  variables  defined  using  the MS-DOS SET
  143.      command.  The environment variables could be set as follows:
  144.  
  145.             C:\>set dbflags=-Cs5 -x3
  146.  
  147.      The   MS-DOS   set   commands  should  be  added  to  the  batch  file
  148.      AUTOEXEC.BAT  so  they will be set at MS-DOS start time.  See also the
  149.      RAMdisk section.
  150.  
  151.      After  DBFLAGS  have  been set the results of the command line will be
  152.      appended with the environment variable.
  153.  
  154.             ex.   C:\>DB -l *.prg
  155.  
  156.                   will be expanded to
  157.  
  158.                   DB -l *.prg -Cs5 -x3
  159.  
  160.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 4
  161.  
  162.  
  163.  
  164.      OPTIONS
  165.  
  166.  
  167.      -C       COMMENT  ON  COLUMN  ONE  -  Positions all comments on Column
  168.               one.    This  option  is for those who like their comments on
  169.               the first column.
  170.  
  171.               ex.     00001: Do while .not. eof()
  172.                       00002: 
  173.                       00003: *   Use trade activity and scan for match
  174.                       00004:     select trades
  175.                       00005: *   make sure trade file starts on TOF
  176.                       00006:     go top
  177.  
  178.               NOTE:   The  only  option  that effects the commented line is
  179.                       -u (untab).
  180.  
  181.  
  182.      -d       DISPLAY  (STDOUT)  -  Send  output to stdout.  This option is
  183.               used  for  piping  and redirection purposes.  The .PRG(s) are
  184.               not  modified  at all.  Options v and W are disabled.  Option
  185.               w is enabled.
  186.  
  187.               ex.     DB -dv file1 file2 | more
  188.  
  189.               Even  thought  verbose  is  requested the option is disabled.
  190.               File1  and  file2  will  be  beautified without modifying the
  191.               original  program (file1.prg, file2.prg).  Output is piped to
  192.               more.
  193.  
  194.  
  195.      -h       HEADER  STAMP  -  Enable header stamp.  Previous header stamp
  196.               will  be replaced by current header.  The header contains the
  197.               current  date and time.  ** PRIOR TO REVISION 1.6 THIS OPTION
  198.               DISABLED THE HEADER STAMP.
  199.  
  200.               ex.     00001: **
  201.                       00002: *
  202.                       00003: *   DBed on Sun. Apr 03, 1988  17:30:03
  203.                       00004: *
  204.                       00005: **
  205.  
  206.  
  207.      -l       LIST  FILE  - Generate a listing file.  A .LST file with line
  208.               numbers  are  generated.   If the option -d is used output is
  209.               send  to  display,  and .LST is not generated.  If -o<str> is
  210.               used output is send to filename <str>.
  211.  
  212.               ex.     DB -lolisting.lst file1
  213.  
  214.               Generate   a   list   file   and   send  output  to  filename
  215.               "listing.lst".
  216.  
  217.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 5
  218.  
  219.  
  220.  
  221.      -o<str>  OUTPUT  FILE  - Redirects output to filename <str>.  Original
  222.               program  files are not modified.  The output of DB is send to
  223.               the file specified.
  224.  
  225.               NOTE:   When  DBing  multi-files,  the -o option is valid for
  226.                       the last file DBed.
  227.  
  228.               ex.     DB -ofile.out file1 file2
  229.  
  230.               File.out contains file2's output.  File1's output is lost.
  231.  
  232.  
  233.      -s<num>  SPACES   -   Use  <num>  spaces  as  leading  characters  for
  234.               indentation.    When  used  with -t, -t overrides -s.  Use of
  235.               -s0  will  eliminate  any  leading spaces, or tabs.  -s0 does
  236.               not remove newlines.  See also -U.
  237.  
  238.               This option is the default with <num> equal 4.
  239.  
  240.  
  241.      -t       TAB  -  Use  tab  character  instead  of  spaces  as  leading
  242.               characters.  A tab per indentation is used.
  243.  
  244.  
  245.      -u<num>  UNTAB  -  Replace  tab  characters  BETWEEN  words with <num>
  246.               spaces.    This  is  not a substitute for -s<num> since -s is
  247.               for  leading  character.    This option is for laser printers
  248.               that do not print out tab characters.
  249.  
  250.               NOTE:   This  option  is  not  a  literal substitution but is
  251.                       dependent  on  the  position  of  the  tab on a given
  252.                       line. 
  253.  
  254.  
  255.      -U       UNBEAUTIFY  -  condense  code  to save spaces by striping all
  256.               leading  White spaces (INCLUDING NEWLINES).  This option will
  257.               enable -s0.
  258.  
  259.               ex.     00001: if this = .t.
  260.                       00002:
  261.                       00003:      do that
  262.                       00004:
  263.                       00005: endif
  264.  
  265.               becomes
  266.  
  267.                       00001: if this = .t.
  268.                       00002: do that
  269.                       00003: endif
  270.  
  271.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 6
  272.  
  273.  
  274.  
  275.      -v       VERBOSE  -  Display  status  of  DB while file is being DBed.
  276.               The   structures   will   be   displayed   with   the  proper
  277.               indentations.    Indentations  of  verbose mode uses 4 spaces
  278.               that are not dependent of -s or -t.
  279.  
  280.  
  281.      -w       NO  ERROR  ON  SCREEN  -  Suppresses Syntax Error messages on
  282.               screen.    Use -W for suppression of syntax error messages in
  283.               program  code  file.    -w disables -W option.  The -d option
  284.               enables  -w  option  so  output on screen is not distorted by
  285.               syntax error messages on screen.
  286.  
  287.  
  288.      -W       NO  ERROR  IN  FILE  -  Suppresses  Syntax  Error messages in
  289.               output file.  This option is disabled if -d or -w is used.
  290.  
  291.  
  292.      -x<num>  EXPRESSION  CONTINUATION  -  Shift  expression  continuations
  293.               represented by ';' with <num> spaces.
  294.  
  295.               ex.     00123: replace code with a->code, sequence with ;
  296.                       00124:   a->seq no, customer with a->id code, ;
  297.                       00125:   interest with a->principle*a->rate
  298.                       00126: do programx
  299.  
  300.               NOTE:   Wrap  around  characters are replaced with ';' and -x
  301.                       is  applied.   If the wrap around character is within
  302.                       a  comment,  a  space  will  replace  the wrap around
  303.                       character.
  304.  
  305.               This option is a default with <num> equaling 2 spaces.
  306.  
  307.  
  308.  
  309.      RAMdisk
  310.  
  311.  
  312.      DBeautifier  sometimes  creates  a  temporary file.  The default drive
  313.      for  the  temporary    files  are the current drive and directory.  DB
  314.      performance  can  be  increased  by  utilizing a RAMdisk.  DBeautifier
  315.      searches  the  environment  for the variable TMP.  Set TMP=path, where
  316.      path  is the location of temporary file to be created.  See also USING
  317.      DB.
  318.  
  319.             ex.   SET TMP=d:\
  320.  
  321.      Drive D is used as the temporary drive.
  322.  
  323.             ex.   SET TMP=d:\tmpdir
  324.  
  325.      Drive  D,  in  directory  tmpdir  is  used  for  the  creation  of the
  326.      temporary file.
  327.  
  328.      Prior  to  revision  2.0 the environment variable DBTMP was used.  Now
  329.      the usage of TMP is supported.  DBTMP is no longer supported.
  330.  
  331.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 7
  332.  
  333.  
  334.  
  335.      ERROR MESSAGES
  336.  
  337.  
  338.      There  are  two  types  of Error messages, Syntax and I/O.  The syntax
  339.      error  is  caused by incorrect coding.  The I/O errors could be caused
  340.      by either Hidden files, Insufficient disk space, or Read-only files.
  341.  
  342.  
  343.      The following messages relate to Syntax Errors
  344.  
  345.             Endif without If
  346.                   Preceding IF <condition> not found
  347.             Else without If
  348.                   Preceding IF <condition> not found
  349.             Elseif without If
  350.                   Preceding IF <condition> not found
  351.             Enddo without Do While
  352.                   Preceding DO WHILE not found
  353.             Case without Do Case
  354.                   Preceding DO CASE not found
  355.             Otherwise without Do Case
  356.                   Preceding DO CASE not found
  357.             Endcase without Do Case
  358.                   Preceding DO CASE not found
  359.             Next without For
  360.                   NEXT must have corresponding FOR
  361.             Procedure encounter while unmatched scoop exist
  362.                   An open structure exist when PROCEDURE encountered
  363.             Function encounter while unmatched scoop exist
  364.                   An open structure exist when FUNCTION encountered
  365.             Illegal use of parameters
  366.                   Preceding FUNCTION or PROCEDURE not found
  367.  
  368.  
  369.      The following messages relate to I/O Errors
  370.  
  371.             Error opening output file
  372.                   Output file specified by -o option may be read-only file
  373.             Error opening input file
  374.                   Input file may not exist
  375.             Error opening temporary file
  376.                   Disk may be full
  377.             Error opening list file
  378.                   File with .LST extension may exist with read-only mode
  379.             Error removing Backup file
  380.                   Old backup file may be a read-only file
  381.             Disk write error
  382.                   Disk may be full
  383.             Incorrect extension used
  384.                   DB expects .PRG extension
  385.  
  386.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 8
  387.  
  388.  
  389.  
  390.      HISTORY
  391.  
  392.  
  393.      Revision 1.5:
  394.  
  395.             o Supports keywords used as memory variables.
  396.             o Error messages displayed on screen now contains line number
  397.               of syntax error.
  398.             o Handles dBASE Editor's Wrap around character.
  399.             o New option -x (Shift Continue Expressions).
  400.  
  401.      Revision 1.6:
  402.  
  403.             o Support of Clipper Summer '87 Extended Syntax.
  404.             o Supports the verbose mode option.
  405.             o New option -W (Suppress Error Messages in output file).
  406.             o TEXT..ENDTEXT is now supported.
  407.             o -h option now ENABLES not disables header stamp.
  408.  
  409.      Revision 1.6.4:
  410.  
  411.             o RAMdisk supported.
  412.             o Options may be entered with either '-' or '/'.
  413.             o DB is now an EXE not a COM.
  414.             o Includes Disk Full Checking.
  415.             o When I/O Error accrues DB will display error message and
  416.               CONTINUE with the next file.
  417.  
  418.      Revision 2.0:
  419.  
  420.             o Supports the four characters syntax.
  421.             o Handles Ctl C/CTL BREAK.
  422.             o Use environment variable TMP instead of DBTMP.
  423.             o Use environment variable DBFLAGS for default options.
  424.             o New option -C (Comments on Column one).
  425.             o Corrected the handling of semicolon within Comments.
  426.             o Syntax Error Messages in output file are now "***" not
  427.               "****"
  428.  
  429.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 9
  430.  
  431.  
  432.  
  433.      GENERAL INFORMATION
  434.  
  435.  
  436.      DB  will  run  on  any  IBM  PC/XT/AT/Portable/Convertible or any True
  437.      MS-DOS  compatible  computer  running  PC/MS-DOS  2.0 or higher with a
  438.      minimum of 128K free RAM.
  439.  
  440.      IBM  is  a  registered trademark of the International Business Machine
  441.      Corporation.
  442.      MS-DOS is a registered trademark of Microsoft Inc.
  443.      dBASE III is a registered trademark of Ashton-Tate
  444.      Clipper is a registered trademark of Nantucket Corporation
  445.  
  446.      Benchmarks  are available upon request.  Please note that DB is a Disk
  447.      intensive  utility.   High performance Hard drives have better results
  448.      on  the benchmark.  Floppy is the Slowest you will get.  Even though a
  449.      RAMdisk  is  used  for temporary files, these files have to be written
  450.      back  to  original  file  location.    High  performance Machines have
  451.      better results.
  452.  
  453.      If  you have any questions, comments or suggestions about DB send them
  454.      to Thomas Li at:
  455.  
  456.      NYCENET BBS, Fred Goldberg SYSOP
  457.                   Buzz Robbins Alt. SYSOP
  458.      New York, New York
  459.      At main menu type "j dbase"
  460.      212-769-0550
  461.      300/1200 baud, 24 hours a day
  462.  
  463.      or
  464.  
  465.      H.Q. BBS, Bob Kurtz & Richard Healy SYSOP
  466.      At main menu type "j db"
  467.      212-790-9290
  468.      300/1200/2400 baud, 6pm - 8am Eastern  24hrs Sat & Sun
  469.  
  470.      or
  471.  
  472.      ** For Technical Questions Related With Computer Languages Only **
  473.      New York BBS Service, Richard Green SYSOP
  474.      New York, New York
  475.      212-980-0770
  476.      300/1200 baud, 24 hours a day
  477.  
  478.  
  479.  
  480.      ACKNOWLEDGMENT
  481.  
  482.  
  483.      Special  thanks  to  Marc Schnapp, president of New York Metro Clipper
  484.      User's  Group,  for suggesting the use of TMP and reminded me of the 4
  485.      character  syntax  support.    Thanks to Jose Vega for his help in the
  486.      Benchmarks  of  DB.    Most  importantly, Thanks to Lord Jesus for His
  487.      help, support, encouragement, and faithful promises.
  488.  
  489.      DBeautifier  -  A dBASE/Clipper Utility   Rev 2.0   Apr 24, 1988  Page 10
  490.  
  491.  
  492.  
  493.      LICENSE
  494.  
  495.  
  496.      DB - Copyright (C) 1988 by Thomas Y. Li.  All Rights Reserved.
  497.  
  498.      Potions Copyright by Allen I. Holub, used with permission.
  499.  
  500.  
  501.      You   are   free   to   use,   copy  and  distribute  DBeautifier  for
  502.      noncommercial use IF:
  503.  
  504.             IT IS NOT MODIFIED IN ANYWAY.
  505.  
  506.             NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
  507.  
  508.      Clubs  and  user  groups  may charge a nominal fee (less than $10) for
  509.      expenses  and  handling while distributing DB.  Remember that I depend
  510.      on you and your colleague's support.
  511.  
  512.      Everyone  is  encouraged  to  distribute  DBeautifier to your friends,
  513.      associates,  or  to  a  Bulletin Board System (BBS), please distribute
  514.      the  file  DB20.EXE  or  DB20.ARC rather than the individual files for
  515.      README.DB,  DB.EXE  and  DB.DOC.    Note  that  DB20.EXE  contains  an
  516.      additional file DB20.ARC.
  517.  
  518.      This  program  is  provided  AS  IS without any warranty, expressed or
  519.      implied,  including  but  not  limited  to  fitness  for  a particular
  520.      purpose.
  521.  
  522.      Remember   that  DBeautifier  is  a  Shareware.    I  depend  on  your
  523.      contributions  for support.  If this product has helped you in anyway,
  524.      please send contributions to:
  525.  
  526.             Thomas Y. Li
  527.             79 Chrystie St. #16
  528.             New York, NY  10002-5014
  529.  
  530.      Feel free to contact me through either NYCENET BBS or New York BBS.
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.