home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBBS / DEMOS / demonods.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-03-09  |  6.3 KB  |  193 lines

  1. (*
  2.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  3.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  4.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  5.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  6.     ▓▓▓▓▓▓▓▓·──                                              ──·▓▓▓▓▓▓▓▓▓▓▓
  7.     ▓▓▓▓▓▓▓▓│                                                  │░░▓▓▓▓▓▓▓▓▓
  8.     ▓▓▓▓▓▓▓▓   DEMONODE was Conceived, Designed and Written     ░░▓▓▓▓▓▓▓▓▓
  9.     ▓▓▓▓▓▓▓▓   by Floor A.C. Naaijkens for                      ░░▓▓▓▓▓▓▓▓▓
  10.     ▓▓▓▓▓▓▓▓   UltiHouse Software / The ECO Group.              ░░▓▓▓▓▓▓▓▓▓
  11.     ▓▓▓▓▓▓▓▓                                                    ░░▓▓▓▓▓▓▓▓▓
  12.     ▓▓▓▓▓▓▓▓   (C) MCMXCII by EUROCON PANATIONAL CORPORATION.   ░░▓▓▓▓▓▓▓▓▓
  13.     ▓▓▓▓▓▓▓▓   All Rights Reserved for The ECO Group.           ░░▓▓▓▓▓▓▓▓▓
  14.     ▓▓▓▓▓▓▓▓                                                    ░░▓▓▓▓▓▓▓▓▓
  15.     ▓▓▓▓▓▓▓▓   This program demonstrates that tremendous        ░░▓▓▓▓▓▓▓▓▓
  16.     ▓▓▓▓▓▓▓▓   speeds can be obtained using oridinary text-     ░░▓▓▓▓▓▓▓▓▓
  17.     ▓▓▓▓▓▓▓▓   buffers, seeking in normal textfiles.            ░░▓▓▓▓▓▓▓▓▓
  18.     ▓▓▓▓▓▓▓▓│                                                  │░░▓▓▓▓▓▓▓▓▓
  19.     ▓▓▓▓▓▓▓▓·──                                              ──·░░▓▓▓▓▓▓▓▓▓
  20.     ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓
  21.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  22.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  23.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  24. *)
  25. {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}
  26. {$M 65520, 0, 655360}
  27.  
  28.  
  29. uses
  30.   dos, crt, eco_lib,
  31.   eco_node,
  32.   eco_tree, eco_file
  33.  
  34.   ;
  35.  
  36.  
  37.  
  38.  
  39. const
  40.   onlyshow   : word    = $0000;
  41.   tx1        : byte    =    10;
  42.   ty1        : byte    =    04;
  43.   tx2        : byte    =    70;
  44.   ty2        : byte    =    22;
  45.   fx1        : byte    =    20;
  46.   fy1        : byte    =    05;
  47.   fx2        : byte    =    59;
  48.   fy2        : byte    =    20;
  49.   fx3        : byte    =    10;
  50.   fy3        : byte    =    10;
  51.   fx4        : byte    =    30;
  52.   fy4        : byte    =    15;
  53.  
  54.   exitwin_f  : byte    =     0;
  55.   treewidth  : byte    =     2;
  56.   inlist     : boolean = false;
  57.   _newline             =   #10;
  58.   noread     : boolean = false;
  59.   nrofrets             =     4;
  60.   rets : array[1..nrofrets] of word = (
  61.     _space, { pad } _c_r, { treescan } _enter, { confirmation }
  62.     _tab
  63.   );
  64.   nroffilrets          =     4;
  65.   filesretkeys : array[1..nroffilrets] of word = (
  66.     _c_r, _enter, _c_p, _tab
  67.   );
  68.  
  69.  
  70. var
  71.   nodedir,
  72.   _curdir, ff :  string;
  73.   falval      : boolean;
  74.  
  75.  
  76.   function __givenodel: string;
  77.   var
  78.     returnedkey :          word;
  79.     tree        :  treepanelobj;
  80.     files       : filespanelobj;
  81.  
  82.  
  83.     function notex: boolean;
  84.     begin
  85.       with tree do begin
  86.         notex := not(
  87.           __existpath(copy(fexpand(trace_path(walkcsr)), 1,
  88.           length(fexpand(trace_path(walkcsr)))-1)) or (s = '\')
  89.         )
  90.       end;
  91.     end;
  92.  
  93.  
  94.     procedure treefunctions;
  95.     begin
  96.       with files, tree do begin
  97.         jump_curpath; draw;
  98.         __write(1, 1, 6, 0, 'No test performed, whether a NODELIST is chosen.');
  99.         __write(1, 2, 6, 0, 'Some small bugs are present in TREE/FILE interface.');
  100.         repeat
  101.           { TREE }
  102.           __write(2, 25, 15, 0, 'Up/Dn/PgUp/PgDn/Home/End/Left/Right Tab/Enter');
  103.           returnedkey := $0000; 
  104.           walk_tree_(@rets, nrofrets, returnedkey);
  105.           nodedir := 'C:'+__backrem(trace_path(walkcsr));
  106.           chdir(nodedir); __savscn(scn1);
  107.           { FILES }
  108.           returnedkey := $0000;
  109.           readfiles(nodedir); startsorting;
  110.           newfiloff := true; filoff := 0; filescursor := 0; falval := false;
  111.           __write(48, 25, 15, 0, '^P');
  112.           __write(2, 24, 15, 0, 'You can use also tagkeys:  *  Gray- Gray+  Ins ^V');
  113.           ff := walk_files_(
  114.             @filesretkeys, nroffilrets, falval, returnedkey
  115.           );
  116.           __resscn(scn1);
  117.         until returnedkey = _enter;
  118.         save_tree(drivechar + treeinfofile);
  119.       end; { with }
  120.     end; { treefunctions }
  121.  
  122.   begin
  123.     with tree do begin
  124.       init; putdefaults; treewidth := 2;
  125.       if _curdevice=_color then setoptions(
  126.         false, true, true, 0, tx1, ty1, tx2, ty2, 15, 1, 15, 1, 0, 14,
  127.         true, 40, 3, 67, 18, 12, 15, 12, 15, 12, 15, 12, 15,   0, 7
  128.       ) else setoptions(
  129.         false, true, true, 0, tx1, ty1, tx2, ty2, 7, 3, 7, 3, 7, 3,
  130.         true, 40, 3, 67, 18, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7
  131.       );
  132.       
  133.       horspace := __rep(treewidth, ' '); horbar := __rep(treewidth, '─');
  134.  
  135.       if not(__existfil(drivechar + treeinfofile)) then begin
  136.         __savscn(scn1); 
  137.         __bandwin(false, x3, y3, x4, y4, popup_f, popup_b, sh_default, bt_double);
  138.         trace_tree; save_tree(drivechar + treeinfofile); __resscn(scn1); 
  139.         build_tree(true);
  140.       end else begin load_tree(drivechar + treeinfofile); build_tree(true) end;
  141.       newtreeoff := true; __clrscn(1,1,80,25,7,0, ' '); 
  142.       with files do begin
  143.         init;
  144.         setoptions(
  145.           true, true, bt_double,
  146.           fx1, fy1, fx2, fy2,
  147.           7, 0, 15, 0, 0, 7,
  148.           true,
  149.           fx3, fy3, fx4, fy4,
  150.           0, 7, 15, 0, 15, 7, 0, 7, 6, 0
  151.         );
  152.       end;
  153.  
  154.       treefunctions; 
  155.     end; 
  156.     __givenodel := nodedir + '\' + ff;
  157.   end;
  158.  
  159.  
  160.  
  161. var
  162.   nodelist: nodelistobj;
  163.   max     :     longint;
  164.   nl,
  165.   st, st1 :      string;
  166.  
  167.  
  168. begin
  169.   _curdir := __curdir; __setblwin(false);
  170.   nl := __givenodel;
  171.   chdir(_curdir);
  172.   with nodelist do begin
  173.     clrscr;
  174.     max := maxavail;
  175.     writeln('Force a recompile: watch that speed!');
  176.     init(NL, true); { name nodelist, compile index }
  177.     max := max - maxavail; writeln('Nodelist memory usage: ', max);
  178.     writeln('Compilation (only 11K index!) complete.');
  179.  
  180.     st := '2:231/77';
  181.     writeln('Seeking: ', st);
  182.     st1 := getnode(st);
  183.     if st1 = '' then writeln('Not found!') else writeln(st1);
  184.  
  185.     st := '2:231/77';
  186.     writeln('Seeking again: ', st);
  187.     st1 := getnode(st);
  188.     if st1 = '' then writeln('Not found!') else writeln(st1);
  189.  
  190.     done(false); { disposes textbuffer, and optionally deletes index }
  191.   end;
  192. end.
  193.