home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbclinic.zip / DBCLINIC.DOC < prev   
Text File  |  1987-02-14  |  6KB  |  120 lines

  1.                           DBCLINIC.BAS
  2.  
  3.        A UTILITY PROGRAM FOR dBASEII (tm) FILE MAINTENANCE
  4.  
  5.  
  6. DESCRIPTION
  7.  
  8. The "Data Base Clinic" is a handy utility to have around when 
  9. working with data base files with extension type .DBF or .TXT but 
  10. of unknown or questionable size or integrity.  It can display 
  11. Structure header information from .DBF files or count the actual 
  12. number of records they contain and allow you to change the record 
  13. count and/or "last update" date.  It can also find the record 
  14. lengths and number of records in .TXT files.  It is written in 
  15. Microsoft's BASIC-80 (tm) (the Disk MBASIC (tm) for CP/M)(tm), 
  16. Version 5.x, and is menu driven and fully prompting.  The program 
  17. contains five Wards, or modes of operation:
  18.  
  19. WARD-A:   This portion of the program displays the Record Length 
  20.           of a given .DBF or .TXT file.  With .DBF files, it gets 
  21.           this information from the file Structure header.  With 
  22.           .TXT files, it actually samples the file and checks the 
  23.           length of the first record (up to 1000 characters--the 
  24.           dBASEII (tm) limit for record length).
  25.  
  26. WARD-B:   Ward-B displays the actual Structure header information 
  27.           from any .DBF file in the .LIST STRUCture format of 
  28.           dBASEII (tm).  This Ward is only available to .DBF files, 
  29.           since .TXT files do not have file Structure headers.  
  30.           Note that, although this is a quick way of finding out 
  31.           how large a file is, in terms of numbers of records, 
  32.           there are times when the number can become corrupted, so 
  33.           that it is actually smaller than it should be--as when a 
  34.           power glitch or computer hangup requires a RESET or re-
  35.           boot, leaving the header information un-updated.  Any time
  36.           a file is not closed by QUITing, this can occur.  In such
  37.           a case, a visit to Wards C and D is in order.
  38.  
  39. WARD-C:   This is the heart of the program!  In this Ward, you 
  40.           can actually get an exact count of the number of 
  41.           records a data base file contains.  It uses a binary 
  42.           search pattern to find the end of the file very 
  43.           quickly, and then backs off 2K bytes and counts to the 
  44.           end of the file.  A final count is usually displayed 
  45.           within 10 seconds or less.  The program limits out at 
  46.           32,767 x 128 bytes (that's 4-megabytes!!--which should 
  47.           cause no problems to the average user).  This Ward is 
  48.           open to both .DBF and .TXT file types.
  49.  
  50. WARD-D:   This Ward is for displaying and changing the Record 
  51.           Count in a file's Structure header, if it happens to be 
  52.           different from the count obtained in Ward-C; a handy 
  53.           tool when the header becomes corrupted, since Sorting and 
  54.           Indexing won't work correctly until the number of re-
  55.           cords in the header is correct.  If you make a mistake
  56.           in your entry, use the BACKSPACE key to rub out to the
  57.           last good digit and reenter.  THE MAXIMUM NUMBER THAT 
  58.           CAN BE ENTERED IS 32,767, because of MBASIC's integer 
  59.           limits.  But then, who has database files over 32,767 
  60.           records long?  This Ward is only for .DBF files.
  61.  
  62. WARD-E:   This Ward allows the Last Update date to be displayed 
  63.           from the file's header and changed.  Suppose you en-
  64.           tered dBASEII (tm) with a 00/00/00 (no entry) date and 
  65.           later thought better about it.  You can easily correct 
  66.           the header date, using Ward E.  Your entry will auto-
  67.           matically be accepted, updated, and verified after the 
  68.           sixth digit is typed in.  You won't have to type in 
  69.           "/" month-day-year separators, nor will they even be
  70.           accepted.  Prior to keying in the last digit, if you
  71.           have made a mistake, hit the BACKSPACE key once to 
  72.           clear your entire entry so you can begin again.
  73.  
  74.  
  75. USING THE PROGRAM
  76.  
  77. As mentioned at the start, the program is menu driven and fully 
  78. prompting.  You just can't make a mistake (well, almost).  It 
  79. will not accept a file name without a .DBF or .TXT extension or 
  80. one with a disk drive designation higher than D: (highest drive 
  81. is easily changed, however).  If you find yourself in a situation 
  82. where you don't know what file name to enter, just enter DIR to 
  83. get a Directory of your disk.  Also, if you are in Wards D or E 
  84. and decide that you don't want to change the file header after 
  85. all, simply reenter the same record count or date that is being 
  86. displayed.
  87.  
  88. One more thing!  If you insert a new disk at any time, you should
  89. immediately "Reset" the program.  This is done by entering a "null" 
  90. filename at the "ENTER FILENAME (DIR=DIRECTORY):" prompt; that is, 
  91. by simply pressing the carriage RETURN key before any other charac-
  92. ter.  The only response you'll notice is some disk drive activity.  
  93. Failure to do this will get you a "Bdos Error: Drive $R/O" error 
  94. from CP/M (tm) in Ward D or E, when the program attempts to write 
  95. the update information back to the file header.
  96.  
  97. In its present form, this program WILL NOT compile under BASCOM 
  98. (tm), due mainly to the use of unusually long variable names.  
  99. It has some other serious problems as well.  Ask me about them!!
  100. Except for a speed-up in program loading, there would be no real 
  101. advantage to compiling, since all significant runtime delays occur 
  102. because of disk accessing, and there is no way to speed that up.
  103.  
  104. Please enjoy this utility!
  105.  
  106.                               Dick Bollinger
  107.  
  108.  
  109.     (P.S. This program has been tested on both floppy and hard
  110.           disk drives!  But if you do find a bug in the program, 
  111.           I'd appreciate it if you would please leave me a mes-
  112.           sage on Stu's RBBS; phone [714] 599-2109; giving full 
  113.           details: Ward you were in, file record length, number 
  114.           of records, ERR and ERL numbers, what happened, etc.
  115.           I'll get back to you; that's a promise.)
  116.  
  117. (tm) "dBASEII" is a trademark of Ashton-Tate
  118.      "BASIC-80","MBASIC", and "BASCOM" are trademarks of Microsoft
  119.      "CP/M" is a trademark of Digital Research
  120.