NBPrg40. TYFILE.PAS. MiniOS. OpenSource.

NBPrg40. TYFILE.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013 }

Unit TYFILE;

(*

   TYFILE.PAS

   +---------------------------+ 
   |                           | 
   |      T Y F I L E          | 
   |                           | 
   +---------------------------+ *)

Interface

Procedure TypeFILE_run;

Implementation

{ Type File }
Procedure TypeFILE_run;
Label
  START;
Var
  Name,S : String;
  T      : Text;

  N,i,j  : Integer;

  Velocity : String;  { (Type File)-> Velocity }
  Delay_param : Integer;

  Ch     : Char;
Begin

START :

  WriteLn(' +---------------------------+ ');
  WriteLn(' |                           | ');
  WriteLn(' |      T Y F I L E          | ');
  WriteLn(' |                           | ');
  WriteLn(' +---------------------------+ ');
  WriteLn('                               ');
  WriteLn(' Nikita Beloshenko (GNU) 2013 ');
  WriteLn(' ----- Type File 2013 {(text) (module)} ----- ');

  WriteLn(' ');

  { (Type File)-> Velocity? }
  Velocity:=' ';
  While ((Velocity<>'1') And (Velocity<>'2')) And
        ((Velocity<>'3') And (Velocity<>'4')) And
        (Velocity<>'5') Do
  Begin
    WriteLn(' ((Type)(File))-> Velocity? ');
    WriteLn(' 1,2,3,4,5? ');
    ReadLn(Velocity);
  End;
  If Velocity='5' Then Delay_param:= 10;
  If Velocity='4' Then Delay_param:= 100;
  If Velocity='3' Then Delay_param:= 1000;
  If Velocity='2' Then Delay_param:= 10000;
  If Velocity='1' Then Delay_param:= 20000;


  WriteLn(' Name? ');

  ReadLn(Name);

  Assign(T,Name);
  Reset(T);

  i:=0;
  While Not eof(T) Do
  Begin
    ReadLn(T,S);
    WriteLn(S);

    Inc(i);
    { Pause }
    For N:=1 To 20000 Do
    Begin
      i:=i+N;
      i:=i-N;
      For j:=1 To Delay_param Do
      Begin
        Ch:='-';
      End;
    End;
    If i Mod 20 = 0 Then
    Begin
      WriteLn(' ---- Press ENTER to see next ---- ');
      Write(' ----  group of   STRINGS  .  ---- ');
      ReadLn;
    End;
  End;

  Close(T);

  { GOTO START ? }

  S := '';

  While ((S<>'y') And (S<>'n')) Do
  Begin
    WriteLn(' ----- GOTO START? (Another File) ----- ');
    WriteLn('y/n');
    ReadLn(S);
  End;

  If S='y' Then Goto START;

End;

End.