home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / dbase / _base16.zip / RUNBASE.DOC < prev    next >
Text File  |  1994-02-13  |  13KB  |  337 lines

  1.  
  2.  
  3.                       The RunBase Utilities
  4.  
  5.                            Version 1.6
  6.  
  7.           (C) Copyright 1991, 1992 All rights reserved.
  8.  
  9.  
  10.                 RunBase (!BASE) is Copyrighted by:
  11.  
  12.                        Cynthia L. Allingham
  13.                      16411 McFadden Ave. #320
  14.                          Tustin, Ca 92680
  15.                           (714) 543-4241
  16.  
  17.     What are the RunBase Utilities?
  18.     ================================================================
  19.     RunBase consists of 7 handy command line utilities for all
  20.     dBase, Clipper, FoxPro and CodeBase programmers.  All of the
  21.     RunBase utilities are small, fast, support IO redirection, and
  22.     full path expansion.
  23.  
  24.     They are easy to use, since they accept the same parameters that
  25.     their DOS or dBase equivalents do.  To get help on any utility,
  26.     just type in the name of the utility without any parameters.
  27.  
  28.     !APPEND <FILENAME.DBF> <FILENAME.TXT> [-Q]
  29.         The worlds fastest Append SDF.  This utility appends records
  30.         10x faster than the APPEND SDF command in FoxPro or Clipper.
  31.  
  32.     !COMP <A:> [<C:>]
  33.         A structure comparison utility.  It compares the file
  34.         structure of any two DBF files, and flags the differences.
  35.  
  36.     !COPY <C:> [<A:>] [-P -Q -Sn]
  37.         The world fastest Database Copy.  In the process of copying
  38.         it will generate a "packed" copy of the DBT file, and
  39.         optionally remove deleted records. USE THIS UTILITY INSTEAD
  40.         OF PACK.
  41.  
  42.     !DIR [<*.*>]
  43.         Directory of DBF files.  This utility displays the number of
  44.         records in each database.
  45.  
  46.     !INDEX [<*.*>]
  47.         Directory of INDEX files.  This utility displays the index
  48.         expression of NDX, NTX, and IDX files.
  49.  
  50.     !STRUCT [<*.*>] [-A -F -N -C]
  51.         Displays the structure of DBF files. The output can be
  52.         created in several different formats that are useful for
  53.         Clipper and CodeBase users.
  54.  
  55.     !ZAP [<*.*>] [-Sn -Y]
  56.         DBF file zapping utility. It allows files to be quickly
  57.         zapped or truncated.
  58.  
  59.  
  60.     ================================================================
  61.                                 !APPEND
  62.                   Append a length delimited text file.
  63.     ================================================================
  64.     !APPEND was inspired by the slowness of the APPEND SDF command
  65.     in Clipper.  So I wrote a stand alone replacement utility called
  66.     !APPEND. It is worlds fastest implementation of APPEND SDF, and
  67.     it has displays a pop up status bar.
  68.  
  69.     I used it to reduce the time it takes to import a large file
  70.     into a dbase file format from HOURS to MINUTES.
  71.  
  72.     EXAMPLE #1: APPENDING THE THIS TEXT FILE TO TEST.DBF
  73.     One common use of the APPEND command, is to import the contents
  74.     of a text file into a database, so you can use it with the dbase
  75.     browse command.  To do this with the contents of RUNBASE.DOC,
  76.     create a dbf file (called TEST) with one 80 character field, and
  77.     type:
  78.  
  79.         !APPEND TEST RUNBASE.DOC
  80.  
  81.     This is also an easy way to fill up an empty DBF file with a
  82.     large volume of completely random dummy data, for testing
  83.     purposes.
  84.  
  85.     This is also an easy way to fill up an empty DBF file with a
  86.     large volume of completely random dummy data, for testing
  87.     purposes.
  88.  
  89.  
  90.     ================================================================
  91.                                  !COMP
  92.                     Compare two database structures
  93.     ================================================================
  94.     !COMP was the first utility I wrote. I decided I needed a
  95.     utility to compare database structures several years ago when I
  96.     traced a bug in a program I inherited to the fact that the
  97.     customer field was defined as being a different length in three
  98.     different databases.
  99.  
  100.     EXAMPLE #1: COMPARING SIMILAR FILE STRUCTURES
  101.     In this example, the customer and prospect file both contain the
  102.     same type of data.  To compare them, specify the name of both
  103.     files:
  104.  
  105.         !COMP CUSTOMER PROSPECT
  106.  
  107.     OUTPUT:
  108.  
  109.         Comparing:    CUSTOMER.DBF             PROSPECT.DBF
  110.         # of Records:            6                       90
  111.         Last Updated:      6/11/92                  9/05/92
  112.             1  NAME         C   29      NAME         C   29
  113.             2  POSITION     C   25      POSITION     C   29   <== Field changed
  114.             3  PHONE1       C   13      PHONE1       C   13
  115.             4  PHONE2       C   13      PHONE2       C   13
  116.             5  STREET       C   29      STREET       C   29
  117.             6  CITY         C   29      CITY         C   29
  118.             7  STATE        C    2      STATE        C    2
  119.             8  ZIP          C    5      ZIP          C    5
  120.             9  BIRTHDAY     D    8      ...................   <== Field deleted
  121.         ** Total **            153                      149
  122.  
  123.     EXAMPLE 2 : DISPLAY DIFFERENCE BETWEEN DIFFERENT VERSIONS
  124.     This utility can also be used in project management.  By
  125.     comparing the current databases with an older version, I can
  126.     quickly determine which fields have been added or changed.
  127.  
  128.     Specify the path name of both the directory that contains your
  129.     old data file, and your new data files:
  130.  
  131.         !COMP C: A:
  132.  
  133.     Or if there is more than one screen of data, use the DOS MORE
  134.     command:
  135.  
  136.         !COMP \oldver\*.* *.* | MORE
  137.  
  138.     The "| MORE" clause, uses the external DOS command MORE, to
  139.     cause the display to pause, after every screen full of data.
  140.  
  141.     Alternatively, you could redirect the output to the printer:
  142.  
  143.         !COMP \oldver\*.* > PRN
  144.  
  145.     Note that the second path name is not specified so it defaults
  146.     to using the current directory.
  147.  
  148.     Use of the clause "| MORE" and "> PRN" is supported by all of
  149.     the RunBase Utilities.  Please see your DOS manual for more
  150.     information about piping and redirection.
  151.  
  152.  
  153.     ================================================================
  154.                                  !COPY
  155.                              Copy DBF files
  156.     ================================================================
  157.     The DOS COPY command is fast and convenient, but it doesn't
  158.     "pack" the DBT files or remove deleted records, and the
  159.     dbase/clipper COPY TO command does, but it is very SLOW.
  160.  
  161.     So I wrote a stand alone utility called !COPY combine the speed
  162.     of the DOS COPY command with the utility of the dbase copy
  163.     command.
  164.  
  165.     The !COPY utility also copies the DBT file, supplies an empty
  166.     DBT file if the DBT file is missing, and gives a warning message
  167.     when it encounters invalid memo field records records.
  168.  
  169.     SYNTAX: !COPY <*.*> [<*.*>] [-P -Q -Sn]
  170.  
  171.          -P = Pack mode (remove deleted records)
  172.          -Q = Quiet mode (do not display the status bar)
  173.          -Sn= Save mode (Copy only the first <n> records)
  174.  
  175.     EXAMPLE #1: PACKING A FILE
  176.     To pack your data, call the !COPY utility with the -P (Pack)
  177.     parameter.  The following batch file creates a packed copy of
  178.     the sample database, and if the !COPY command does not return an
  179.     errorlevel it deletes the sample and renames the file.
  180.  
  181.         !COPY SAMPLE TEMP -P >> ERRORLOG
  182.         IF ERRORLEVEL 1 GOTO END
  183.         DEL SAMPLE.DB?
  184.         REN TEMP.DB? SAMPLE.*
  185.         :END
  186.  
  187.     EXAMPLE #2: COPYING A DATA SUBSET
  188.     Clients often have more data than you wish to use for testing
  189.     purposes.  To copy only the first 100 records of a clients data
  190.     to a floppy to use as sample data, type:
  191.  
  192.         !COPY *.* A: -S100
  193.  
  194.  
  195.     ================================================================
  196.                                   !DIR
  197.                      Directory Listing of DBF files
  198.     ================================================================
  199.     !DIR is a replacement for the DIR command to use with DBF files.
  200.     It displays information about DBF files, including the number of
  201.     records.
  202.  
  203.     EXAMPLE #1: DISPLAY A LIST OF DATABASE FILES A PAGE AT A TIME
  204.     The output can be piped into the more command, using the pipe
  205.     symbol "|", will cause the output to pause after displaying a
  206.     screen full of information:
  207.  
  208.         !DIR | MORE
  209.  
  210.     OUTPUT:
  211.  
  212.         Database Files    # Records    Last Update       Size
  213.           COMP.DBF            2,638    08/18/92     1,824,333
  214.           CPU.DBF            18,990    08/18/92     1,994,497
  215.           KEYS.DBF               10    06/15/92           289
  216.           MENU.DBF                8    06/19/92           307
  217.           OS.DBF                 10    05/14/92         1,497
  218.  
  219.         3,820,923 bytes in 5 files.
  220.  
  221.  
  222.     ================================================================
  223.                                  !INDEX
  224.                     Directory Listing of index files
  225.     ================================================================
  226.     Another problem I was having is with remembering which index was
  227.     which.  Let's face it, it is difficult to create fully
  228.     descriptive file names with a maximum of eight characters. So I
  229.     decided to write another utility, !INDEX.
  230.  
  231.     !INDEX operates the way the DIR command does, but it provides
  232.     more information about index files, including the original
  233.     expression that was used to build the index.
  234.  
  235.     EXAMPLE #1: DISPLAYING THE INDEXES ON THE CUSTOMER FILE
  236.     Since all indexes on a given file usually start with the same
  237.     letter, wild cards can be used to select only the indexes on
  238.     the customer file:
  239.  
  240.         !index cust*
  241.  
  242.     OUTPUT:
  243.  
  244.         Index Name     Size  Index Expression
  245.         CUST_1.NTX    2,048  company+state+city
  246.         CUST_2.NTX    4,096  cust_no
  247.  
  248.         4,096 bytes in 2 files.
  249.  
  250.  
  251.     ================================================================
  252.                                 !STRUCT
  253.                    DBF file structure listing utility
  254.     ================================================================
  255.     !STRUCT displays the structure of a DBF from the DOS prompt.
  256.  
  257.     EXAMPLE #1: PRINTING A HARD COPY OF ALL DATABASE STRUCTURES
  258.     Use the redirection symbol ">" to pipe the output to the
  259.     printer:
  260.  
  261.         !STRUCT *.* > PRN
  262.  
  263.     !STRUCT has a number of command line switches that will produce
  264.     output suitable for importing into PRG's and using to create
  265.     REPLACE statements, header files, or an array for use by
  266.     DBCREATE().
  267.  
  268.     OPTIONS FOR USE WITH CLIPPER:
  269.         -A Create database structure arrays for use with DBCREATE()
  270.         -F Create field name declarations
  271.         -N Create field number define statements for use in header files
  272.  
  273.         EXAMPLE #2: GENERATING CODE FOR USE WITH DBCREATE()
  274.         Use the -A parameter to specify database structure output,
  275.         and redirect the output to a source code file:
  276.  
  277.             !STRUCT CONFIG.DBF -A > CREATE.PRG
  278.  
  279.         For information on how to use this utility to enhance your
  280.         clipper programs, read the file CLIPPER.DOC.
  281.  
  282.  
  283.     OPTIONS FOR USE WITH CODEBASE:
  284.         -C Create database structure arrays for use with d4create()
  285.  
  286.         EXAMPLE #3: GENERATING CODE FOR USE WITH d4create()
  287.         Use the -C parameter to specify database structure output,
  288.         and redirect the output to a source code file:
  289.  
  290.             !STRUCT CONFIG.DBF -C > CREATE.C
  291.  
  292.  
  293.     ================================================================
  294.                                   !ZAP
  295.                        Zap or truncate DBF files
  296.     ================================================================
  297.     !ZAP does the opposite of !APPEND.  !APPEND adds records, !ZAP
  298.     deletes them.
  299.  
  300.     SYNTAX: !ZAP [<*.*>] [-Sn -Y]
  301.  
  302.          -Sn Save first <n> records and zap the rest
  303.          -Y  Yes, automatically bypass the safety prompt and zap away
  304.  
  305.     EXAMPLE #1: ZAP ALL FILES
  306.  
  307.         !ZAP
  308.  
  309.     The default to zap all data, and ask if your sure for each file.
  310.  
  311.     EXAMPLE #2: REMOVE EXCESSIVE TEST DATA
  312.     To retain only the  first 50 records in the customer file:
  313.  
  314.         !ZAP CUSTOMER -S50
  315.  
  316.     EXAMPLE #3: ZAP WITHOUT PROMPTING
  317.     To zap all files beginning with the letters "TEMP" without
  318.     prompting:
  319.  
  320.         !ZAP TEMP*.* -Y
  321.  
  322.     Cynthia Allingham Software Services
  323.     ================================================================
  324.     I am a professional programmer located in Tustin California,
  325.     specializing in developing business applications in Clipper and
  326.     C++.
  327.  
  328.     I wrote the RunBase utilities because there aren't very many
  329.     good utilities to available for use with dBase files.  I made
  330.     the RunBase utilities free and kept its size small, so that you
  331.     can easily and legally install a copy of these handy utilities
  332.     on your clients hard disk.
  333.  
  334.     While the RunBase utilities are free, I do appreciate hearing
  335.     about them from the users.  If you have comments or suggestions
  336.     please contact me. 
  337.