home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / BREAK201.ZIP / BREAKER.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1989-04-08  |  2.9 KB  |  101 lines

  1.  { 04/08/89 }
  2.  { Breaker V2.01 Source Code in Borland's Turbo Pascal 5.0   }
  3.  { Modify this program as you wish, but if you do, I would   }
  4.  { like the new copy. Also, any modifications must be        }
  5.  { documented in BREAKER.DOC. Commments and Sugestions are   }
  6.  { welcome.                                                  }
  7.  {   Copyright (C) 1989 CollisionWare(tm) Premium SoftWare   }
  8.  {        < Collision Theory(tm) PMBBS (703)425-4674 >       }
  9.  
  10. { For this particular listing, modifications to the original }
  11. { are indicated by appropriate comments. }
  12. { --Kurt M. Becker }
  13.  
  14. program BREAKER;
  15.  
  16. var fn1,fn2:string[40]; f1,f2:text; Par:boolean; i,startl,endl:integer;
  17.     s:string[80]; opened:boolean;
  18.  
  19. { K.B. }
  20. var
  21.    FileBuf : array[ 1..200 ] of String;
  22.    BufIndex : byte;
  23.  
  24. { K.B. }
  25. procedure LoadIntoBuffer;
  26. begin
  27.    BufIndex := 0;
  28.    while (not Eof( f1 )) and (BufIndex < 200) and (i < endl+1) do
  29.       begin
  30.          BufIndex := BufIndex + 1;
  31.          readln( f1, FileBuf[ BufIndex ] );
  32.          i := i + 1;
  33.       end;
  34. end;
  35.  
  36. { K.B. }
  37. procedure SaveFromBuffer;
  38. var Index : byte;
  39. begin
  40.    for Index := 1 to BufIndex
  41.       do writeln( f2, FileBuf[ Index ] );
  42. end;
  43.  
  44. procedure quit;
  45. begin
  46.     if opened then close( f1 );
  47.     writeln;
  48.     writeln('Thanks for using Breaker v2.01 by Kito Mann!');
  49.     writeln('Call the Collision Theory(tm) PM-BBS (703)425-4674 10PM-7AM!');
  50.    halt;
  51. end;
  52.  
  53. begin
  54.    Opened:=false;
  55.    Par:=false;
  56.    if not (ParamStr(1)='') then begin
  57.     Par:=True;
  58.     fn1:=ParamStr(1);
  59.    end;
  60.    writeln;
  61.    writeln('──────────CollisionWare·Premium·SoftWare·Presents─────────');
  62.    writeln('█████████████ Breaker ▌ V2.01 ▌ By Kito Mann █████████████');
  63.    writeln('                  Copyright (C) 1989                      ');
  64.    writeln('            Modifications made by Kurt Becker             ');
  65.    write('══════════════ Seperates  <>  Text Files ════════════════'); writeln(#205);
  66.    writeln('──────────────────────────────────────────────────────────');
  67.    writeln;
  68.    if not par then begin
  69.     write('Enter filename to break up [Enter=quit]:');
  70.     readln(fn1);
  71.     if fn1 = '' then quit;
  72.    end;
  73.     assign(f1,fn1);
  74.     {$I-} reset(f1) {$I+};
  75.     opened:=true;
  76.     if ioresult <> 0 then writeln('That file doesn''t exist!') else
  77.     repeat
  78.      write('Enter new filename [Enter=quit]:');
  79.      readln(fn2);
  80.      if fn2 = '' then quit;
  81.      write('Enter line to start at:');
  82.      readln(startl);
  83.      if startl <= 0 then quit;
  84.      write('Enter line to end at:');
  85.      readln(endl);
  86.      if endl <= 0 then quit;
  87.      writeln;
  88.      write('Creating new file...');
  89.       assign(f2,fn2);;
  90.       rewrite(f2);
  91.       for i:=1 to startl-1 do readln(f1);
  92.       i:=startl;
  93.       repeat
  94.        LoadIntoBuffer;  { K.B. }
  95.        SaveFromBuffer;  { K.B. }
  96.       until (i = endl+1) or (eof(f1));
  97.       close(f2);
  98.       writeln('Done!');
  99.      until fn2 = '';
  100. end.
  101.