NBPrg40. CRFILE.PAS. MiniOS. OpenSource.

NBPrg40. CRFILE.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013 }

Unit CRFILE;

(*
   CRFILE.PAS

   +---------------------------+ 
   |                           | 
   |      C R F I L E          | 
   |                           | 
   +---------------------------+ *)

Interface

Procedure CRFILE_run;

Implementation

{ Create File }
Procedure CRFILE_run;
Label
  START;
Var
  Name,S : String;
  T      : Text;
  N,i    : Integer;
  Ch     : Char;
Begin

START :

  WriteLn(' +---------------------------+ ');
  WriteLn(' |                           | ');
  WriteLn(' |      C R F I L E          | ');
  WriteLn(' |                           | ');
  WriteLn(' +---------------------------+ ');
  WriteLn('                               ');
  WriteLn(' Nikita Beloshenko (GNU) 2013 ');
  WriteLn(' ----- Create File 2013 {(text) (module)} ----- ');

  WriteLn(' ');

  WriteLn(' Name? ');

  ReadLn(Name);

  Assign(T,Name);
  ReWrite(T);

  WriteLn(' (N)(Strings) N? ');

  ReadLn(N);

  { N>100 ? }
  If (N>100) Then
  Begin
    WriteLn(N,' ?[y/n] ');
    ReadLn(Ch);
    If Ch='n' Then Goto START;
  End;

  For i := 1 To N Do
  Begin
    WriteLn(' (',i,')(String) ?');
    ReadLn(S);
    WriteLn(T,S);
  End;

  Close(T);
End;

End.