home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / techs.zip / TECH10.ARC / FIXHEAD.BAS next >
BASIC Source File  |  1985-10-29  |  1KB  |  26 lines

  1. 100 'Program.: FIXHEAD.BAS
  2. 110 'Author..: Luis A. Castro
  3. 115 'Date....: 12/19/84
  4. 120 'Notes...: BASIC program to change the record count of a dBASE II
  5. 122 '          database file.  To run this program, type the following:
  6. 125 '
  7. 130 '    A>MBASIC FIXHEAD    (MicroSoft BASIC)
  8. 140 '    A>BASICA FIXHEAD    (IBM-PC BASIC)
  9. 150 '
  10. 200 PRINT 'Change record count on header of DBF file"
  11. 210 PRINT
  12. 220 INPUT "Enter FILENAME.EXT ",FILENAME$   'Get the filename
  13. 230 OPEN "R", #1, FILENAME$, 3              'Open the file
  14. 240 FIELD #1, 1 AS DUMMY$, 2 AS OLDVAL$     'Field of 3 bytes
  15. 250 GET #1, 1                               'Get the first record
  16. 260 PRINT "Number of records ";CVI(OLDVAL$) 'Old record count
  17. 270 INPUT "        Change to  ",NEWVAL%     'Get new record count
  18. 280 LSET OLDVAL$=MKI$(NEWVAL%)              'Replace old with new
  19. 290 PUT #1, 1                               'Save the record
  20. 300 CLOSE #1                                'Close the file
  21. 400 OPEN "R", #1, FILENAME$, 1  'Open the file again
  22. 410 FIELD #1, 1 AS ONEBYTE$     'Field record to 1 byte
  23. 420 LSET ONEBYTE$=" "           'Replace field value with a blank
  24. 430 PUT #1, 522                 'Save the blank to byte 522
  25. 440 CLOSE #1                    'Close the file
  26. 450 SYSTEM                      'Exit to the operating system