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

  1. type str_66 = string[66];
  2.  
  3. var file_in: file of char;
  4.     i: integer;
  5.     ch: char;
  6.     dbf_name, ndx_name: str_66;
  7.  
  8. const blanks = '                            ';
  9.  
  10. function exist(file_name: str_66): boolean;
  11. var fil: file;
  12. begin
  13.    assign(fil,file_name); {$I-} reset(fil); close(fil); {$I+} exist:=(ioresult=0);
  14. end;
  15.  
  16. 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); dbf_name:='';
  19.       for i:=1 to 16 do begin read(file_in,ch); dbf_name:=dbf_name+upcase(ch); end;
  20.       close(file_in);
  21.       if exist(dbf_name) then writeln('The .DBF file for this index is: ',dbf_name)
  22.       else begin
  23.          writeln(dbf_name,' is given.  If this is garbage, use INSERT.COM to tag');
  24.          writeln('this index to its .DBF file.');
  25.       end;
  26.    end else begin
  27.       writeln('PICKIT.COM retrieves the .DBF filename from the requested .NDX header.');
  28.       writeln('The syntax is: PICKIT ndxfilename      : without the extension.');
  29.       writeln('The associated file is INSERT.COM');
  30.    end;
  31. end.
  32.  
  33.