NBPrg40. INST.PAS. MiniOS. OpenSource.

NBPrg40. INST.PAS. MiniOS. OpenSource.
***************************************

{ Nikita Beloshenko (GNU) 2013  }

{ NBPRG23 -> ... -> NBPRG40 }

{ Nikita Beloshenko (GNU) 2012 }

Unit Inst;

(******************************************
 *                                        *
 *   INST.PAS                             *
 *                                        *
 *   Inst.                                *
 *                                        *
 ******************************************)

Interface

Uses Graph, Crt;

Procedure DoInstHelp;

Procedure DoInst;

Implementation


Procedure DrawRectangle(Var x1,y1,x2,y2:Integer);
Begin
  Line(x1,y1,x2,y1);
  Line(x2,y1,x2,y2);
  Line(x2,y2,x1,y2);
  Line(x1,y2,x1,y1);
End;

Procedure DoInstHelp;
Var
  x1,y1,x2,y2 : Integer;
  ch1 : Char;
Begin
  x1 := 150; x2 := 600;
  y1 := 150; y2 := 300;

  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);

  ch1:=' ';

  While Ord(ch1)<>27 Do
  Begin
    SetColor(2);
    DrawRectangle(x1,y1,x2,y2);
    SetTextStyle(2, HorizDir, 5);
    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7,'install/del customer task.');

    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7 + 20,'1). + unit(head of NBPRG40.pas); ');

    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7 + 40,'2). + create unit (from SIMPLE.pas); ');

    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7 + 60,'3). + register at LIST.TCK; ');

    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7 + 80,'4). + (edit at NBPRG40.pas) procedure ExecuteTask; ');

    ch1 := ReadKey;
  End;
  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);
End;

Procedure DoInst;
Var
  x1,y1,x2,y2 : Integer;
  ch1 : Char;
  TFile : Text;
Begin
  x1 := 150; x2 := 600;
  y1 := 150; y2 := 300;

  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);

  ch1:=' ';

  While Ord(ch1)<>27 Do
  Begin
    SetColor(2);
    DrawRectangle(x1,y1,x2,y2);
    SetTextStyle(2, HorizDir, 5);
    OutTextXY(x1 + (x2-x1) Div 7,
              y1 + (y2-y1) Div 7,'Standart SIMPLE.PAS is loading now.');

    ch1 := ReadKey;
  End;
  SetFillStyle(0,SolidFill);
  Bar(x1,y1,x2,y2);

  Assign(TFile,'Simple.pas');
  ReWrite(TFile);
  WriteLn(TFile,'{ Nikita Beloshenko (GNU) 2013  }');
  WriteLn(TFile,'');
  WriteLn(TFile,'{ NBPRG23 -> ... -> NBPRG40 }');
  WriteLn(TFile,'');
  WriteLn(TFile,'{ Nikita Beloshenko (GNU) 2012 }');
  WriteLn(TFile,'');
  WriteLn(TFile,'Unit Simple;');
  WriteLn(TFile,'');
  WriteLn(TFile,'(*************************************************');
  WriteLn(TFile,' *                                               *');
  WriteLn(TFile,' *   SIMPLE.PAS                                  *');
  WriteLn(TFile,' *                                               *');
  WriteLn(TFile,' *   Simple.                                     *');
  WriteLn(TFile,' *                                               *');
  WriteLn(TFile,' *************************************************)');
  WriteLn(TFile,'');
  WriteLn(TFile,'Interface');
  WriteLn(TFile,'');
  WriteLn(TFile,'Uses Graph, Crt;');
  WriteLn(TFile,'');
  WriteLn(TFile,'Procedure DoSimple;');
  WriteLn(TFile,'');
  WriteLn(TFile,'Implementation');
  WriteLn(TFile,'');
  WriteLn(TFile,'Procedure DrawRectangle(Var x1,y1,x2,y2:Integer);');
  WriteLn(TFile,'Begin');
  WriteLn(TFile,'  Line(x1,y1,x2,y1);');
  WriteLn(TFile,'  Line(x2,y1,x2,y2);');
  WriteLn(TFile,'  Line(x2,y2,x1,y2);');
  WriteLn(TFile,'  Line(x1,y2,x1,y1);');
  WriteLn(TFile,'End;');
  WriteLn(TFile,'');
  WriteLn(TFile,'');
  WriteLn(TFile,'Procedure DoSimple;');
  WriteLn(TFile,'Var');
  WriteLn(TFile,'  x1,y1,x2,y2 : Integer;');
  WriteLn(TFile,'  ch1 : Char;');
  WriteLn(TFile,'Begin');
  WriteLn(TFile,'  x1 := 200; x2 := 300;');
  WriteLn(TFile,'  y1 := 200; y2 := 300;');
  WriteLn(TFile,'');
  WriteLn(TFile,'  SetFillStyle(0,SolidFill);');
  WriteLn(TFile,'  Bar(x1,y1,x2,y2);');
  WriteLn(TFile,'');
  WriteLn(TFile,'  While Ord(ch1)<>27 Do');
  WriteLn(TFile,'  Begin');
  WriteLn(TFile,'    SetColor(2);');
  WriteLn(TFile,'    DrawRectangle(x1,y1,x2,y2);');
  WriteLn(TFile,'    SetTextStyle(2, HorizDir, 5);');
  WriteLn(TFile,'    OutTextXY(x1 + (x2-x1) Div 4,');
  WriteLn(TFile,'              y1 + (y2-y1) Div 4,''Simple'');');
  WriteLn(TFile,'');
  WriteLn(TFile,'    ch1 := ReadKey;');
  WriteLn(TFile,'  End;');
  WriteLn(TFile,'  SetFillStyle(0,SolidFill);');
  WriteLn(TFile,'  Bar(x1,y1,x2,y2);');
  WriteLn(TFile,'End;');
  WriteLn(TFile,'');
  WriteLn(TFile,'End.');
  Close(TFile);
End;

End.