home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
techs.zip
/
TECH10.ARC
/
FIXHEAD.BAS
next >
Wrap
BASIC Source File
|
1985-10-29
|
1KB
|
26 lines
100 'Program.: FIXHEAD.BAS
110 'Author..: Luis A. Castro
115 'Date....: 12/19/84
120 'Notes...: BASIC program to change the record count of a dBASE II
122 ' database file. To run this program, type the following:
125 '
130 ' A>MBASIC FIXHEAD (MicroSoft BASIC)
140 ' A>BASICA FIXHEAD (IBM-PC BASIC)
150 '
200 PRINT 'Change record count on header of DBF file"
210 PRINT
220 INPUT "Enter FILENAME.EXT ",FILENAME$ 'Get the filename
230 OPEN "R", #1, FILENAME$, 3 'Open the file
240 FIELD #1, 1 AS DUMMY$, 2 AS OLDVAL$ 'Field of 3 bytes
250 GET #1, 1 'Get the first record
260 PRINT "Number of records ";CVI(OLDVAL$) 'Old record count
270 INPUT " Change to ",NEWVAL% 'Get new record count
280 LSET OLDVAL$=MKI$(NEWVAL%) 'Replace old with new
290 PUT #1, 1 'Save the record
300 CLOSE #1 'Close the file
400 OPEN "R", #1, FILENAME$, 1 'Open the file again
410 FIELD #1, 1 AS ONEBYTE$ 'Field record to 1 byte
420 LSET ONEBYTE$=" " 'Replace field value with a blank
430 PUT #1, 522 'Save the blank to byte 522
440 CLOSE #1 'Close the file
450 SYSTEM 'Exit to the operating system