home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBBS / DEMOS / demonode.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-04-01  |  1.0 KB  |  45 lines

  1. uses
  2.   crt, dos, 
  3.   eco_node, eco_lib
  4.  
  5.   ;
  6.  
  7.  
  8. const
  9.   recompile : boolean = false;
  10.  
  11. var
  12.   nodelist  : nodelistobj;
  13.   nodel,
  14.   nodepath,
  15.   st, st1   :      string;
  16.   srec      :   searchrec;
  17.   i         :        word;
  18.  
  19.  
  20.  
  21. begin
  22.   writeln('FindNode -- find a 3D node in the nodelist  (/c recompiles)');
  23.   nodepath := __normfil(__backapp(getenv('nodelist')));
  24.   findfirst(nodepath + 'nodelist.*', anyfile, srec);
  25.   nodel := __normfil(nodepath + srec.name);
  26.   __cls; gotoxy(1, 14);
  27.   writeln('Nodelist found: ' + __slashfil(nodel));
  28.   recompile := __inparams('/c', i);
  29.   st := paramstr(1);
  30.   with nodelist do begin
  31.     init(nodel, recompile);      { do not compile index }
  32.     if recompile then halt(1);
  33.     repeat
  34.       if st <> '' then begin
  35.         starttimer(2);
  36.         st1 := getnode(st);
  37.         if st1 = '' then writeln('Not found!') else writeln(st1);
  38.         writeln('Found in: ', getlaptime(2));
  39.       end;
  40.       readln(st);
  41.     until st = '';
  42.     done(false);           { keep index }
  43.   end;
  44. end.
  45.