home *** CD-ROM | disk | FTP | other *** search
- {$A+,B+,D-,E+,F-,I-,L-,N-,O-,R-,S-,V-}
- {$M 16384,0,655360}
-
- Program Demo4;
-
- Uses Crt,TPDB;
-
- begin
- DBOpenFile('demo4.dbf');
- If TotalRecs>0 then Zap;
- ClrScr;
- Writeln('Appending 1000 blank records to DEMO4.dbf....');
- FillRecs(1000);
- Writeln;
- Writeln('Replacing Last Name field in each record....');
- ReplEach(1,'Corll');
- Writeln;
- Writeln('Replacing Last Name field in record # 899..');
- GetDBRec(899);
- Repl(1,'Smith');
- PutDBRec(899);
- Writeln;
- Writeln('Building index on last name field...');
- BuildIndex('demo4.ndx',1,10,Duplicates);
- OpenDBIndex('demo4.ndx',10,Duplicates);
- Writeln;
- Find('Smith');
- If Found then Writeln('Found record for last name ''Smith''');
- Writeln;
- Writeln('Deleting record for last name ''Smith''');
- Writeln;
- Writeln('Deleting index key for last Name ''Smith''');
- Mark;
- DelDBKey(1);
- Find('Smith');
- Writeln;
- If not Found then Writeln('Key has now been deleted.');
- Writeln;
- Writeln('Packing file....');
- Pack;
- Writeln;
- Writeln('''Smith'' has now been deleted from DEMO4.dbf.');
- Writeln;
- Writeln('TPDB Version 1.3');
- Zap;
- CloseDBFile;
- CloseDBIndex;
- end.