home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / db_dbug2.zip / INSERT.PAS < prev    next >
Pascal/Delphi Source File  |  1987-02-18  |  1KB  |  31 lines

  1. type str_66 = string[66];
  2.  
  3. var file_in: file of char;
  4.     i: integer;
  5.     dbf_name, ndx_name: str_66;
  6.  
  7. const blanks = '                            ';
  8.  
  9. function exist(file_name: str_66): boolean;
  10. var fil: file;
  11. begin
  12.    assign(fil,file_name); {$I-} reset(fil); close(fil); {$I+} exist:=(ioresult=0);
  13. end;
  14.  
  15. begin
  16.    if paramcount=2 then begin
  17.       ndx_name:=paramstr(1)+'.ndx'; if exist(ndx_name) then begin
  18.          assign(file_in,ndx_name); reset(file_in); seek(file_in,496);
  19.          dbf_name:=paramstr(2)+'.DBF'+chr(0)+copy(blanks,1,11-length(paramstr(2)));
  20.          for i:=1 to 16 do write(file_in,dbf_name[i]);
  21.          close(file_in);
  22.       end;
  23.    end else begin
  24.       writeln('INSERT.COM puts the name of the appropriate .DBF file into the');
  25.       writeln('designated .NDX header (dBASE III files) at 02F0h.  The syntax is:');
  26.       writeln('INSERT ndxfilename dbffilename    ; without extensions.');
  27.       writeln('The associated file is PICKIT.COM.');
  28.    end;
  29. end.
  30.  
  31.