home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 341.img / TCS161S.ZIP / TCSUE.PAS < prev    next >
Pascal/Delphi Source File  |  1989-11-24  |  10KB  |  356 lines

  1. Uses Dos,Crt,gentypes;
  2.  Var
  3.     Infile         :File of Userrec;
  4.     UserRecs       :Userrec;
  5.     Place,a,b,c,d,e:Integer;
  6.     Flag           :boolean;
  7.     Choice         :Char;
  8.     Counter        :Integer;
  9.     UserNum        :Integer;
  10.  
  11. Procedure Show_Fields;
  12. Begin
  13. TextColor(9);
  14.   Gotoxy(2,2);Write('Handle');
  15.   Gotoxy(2,3);Write('User Note');
  16.   Gotoxy(2,4);Write('Password');
  17.   Gotoxy(2,5);Write('Main Level');
  18.   Gotoxy(2,6);Write('File Level');
  19.   Gotoxy(2,7);Write('Phone Number');
  20.   Gotoxy(2,8);Write('Time Today');
  21.   Gotoxy(2,9);Write('File Points');
  22.   Gotoxy(2,10);Write('Upload K');
  23.   Gotoxy(2,11);Write('Download K');
  24.   Gotoxy(2,12);Write('Uploads');
  25.   Gotoxy(2,13);Write('Downloads');
  26.   Gotoxy(2,14);Write('Gfile Level');
  27.   Gotoxy(2,15);Write('Gfile UL''s');
  28.   Gotoxy(2,16);Write('Gfile DL''s');
  29.   Gotoxy(2,17);Write('Total Time');
  30.   Gotoxy(2,18);Write('Macro')
  31. End;
  32.  
  33. Procedure Place_Cursor;
  34.  Begin
  35.   With Userrecs do
  36.    Begin
  37.     Case Place of
  38.     1:begin TextColor(10);Gotoxy(2,2);Write('Handle');     end;
  39.     2:begin TextColor(10);Gotoxy(2,3);Write('User Note');  end;
  40.     3:begin TextColor(10);Gotoxy(2,4);Write('Password');   end;
  41.     4:begin TextColor(10);Gotoxy(2,5);Write('Main Level'); end;
  42.     5:begin TextColor(10);Gotoxy(2,6);Write('File Level'); end;
  43.     6:begin TextColor(10);Gotoxy(2,7);Write('Phone Number');end;
  44.     7:begin TextColor(10);Gotoxy(2,8);Write('Time Today');  end;
  45.     8:begin TextColor(10);Gotoxy(2,9);Write('File Points'); end;
  46.     9:begin TextColor(10);Gotoxy(2,10);Write('Upload K');   end;
  47.    10:begin TextColor(10);Gotoxy(2,11);Write('Download K'); end;
  48.    11:begin TextColor(10);Gotoxy(2,12);Write('Uploads');    end;
  49.    12:begin TextColor(10);Gotoxy(2,13);Write('Downloads');  end;
  50.    13:begin TextColor(10);Gotoxy(2,14);Write('Gfile Level');end;
  51.    14:begin TextColor(10);Gotoxy(2,15);Write('Gfile UL''s');end;
  52.    15:Begin TextColor(10);Gotoxy(2,16);Write('Gfile DL''s');end;
  53.    16:Begin TextColor(10);Gotoxy(2,17);Write('Total Time'); end;
  54.    17:Begin TextColor(10);Gotoxy(2,18);Write('Macro');   end
  55.   End
  56.  End
  57. End;
  58.  
  59. Procedure Read_Cursor;
  60.  Begin
  61.   With Userrecs do
  62.    Begin
  63.     Case Place of
  64.     1:begin TextColor(12);Gotoxy(16,2);Readln(Handle);      End;
  65.     2:Begin TextColor(12);Gotoxy(16,3);Readln(Note);        End;
  66.     3:Begin TextColor(12);Gotoxy(16,4);Readln(password);    End;
  67.     4:Begin TextColor(12);Gotoxy(16,5);Readln(level);       End;
  68.     5:Begin TextColor(12);Gotoxy(16,6);Readln(udlevel);     End;
  69.     6:Begin TextColor(12);Gotoxy(16,7);Readln(phonenum);    End;
  70.     7:Begin TextColor(12);Gotoxy(16,8);Readln(timetoday);   End;
  71.     8:Begin TextColor(12);Gotoxy(16,9);Readln(udpoints);    End;
  72.     9:Begin TextColor(12);Gotoxy(16,10);Readln(upk);        End;
  73.    10:Begin TextColor(12);Gotoxy(16,11);Readln(Downk);      End;
  74.    11:Begin TextColor(12);Gotoxy(16,12);Readln(uploads);    End;
  75.    12:Begin TextColor(12);Gotoxy(16,13);Readln(downloads);  End;
  76.    13:Begin TextColor(12);Gotoxy(16,14);Readln(gflevel);    End;
  77.    14:Begin TextColor(12);Gotoxy(16,15);Readln(gfuploads);  End;
  78.    15:Begin TextColor(12);Gotoxy(16,16);Readln(gfdownloads);End;
  79.    16:Begin TextColor(12);Gotoxy(16,17);Readln(totaltime);  End;
  80.    17:Begin TextColor(12);Gotoxy(16,18);Readln(macro);     End
  81.   End
  82.  End
  83. End;
  84.  
  85.  
  86. Procedure List_Rec;
  87.    Begin
  88.    TextColor(4);
  89.     Seek(infile,Usernum);
  90.     Read(Infile,Userrecs);
  91.     Gotoxy(57,15);Write('UserNumber: ',Usernum);
  92.     With UserRecs do
  93.     Begin
  94.       Gotoxy(16,2);Write(Handle);
  95.       Gotoxy(16,3);Write(Note);
  96.       Gotoxy(16,4);Write(password);
  97.       Gotoxy(16,5);Write(level);
  98.       Gotoxy(16,6);Write(udlevel);
  99.       Gotoxy(16,7);Write(phonenum);
  100.       Gotoxy(16,8);Write(timetoday);
  101.       Gotoxy(16,9);Write(udpoints);
  102.       Gotoxy(16,10);Write(upk);
  103.       Gotoxy(16,11);Write(Downk);
  104.       Gotoxy(16,12);Write(uploads);
  105.       Gotoxy(16,13);Write(downloads);
  106.       Gotoxy(16,14);Write(gflevel);
  107.       Gotoxy(16,15);Write(gfuploads);
  108.       Gotoxy(16,16);Write(gfdownloads);
  109.       Gotoxy(16,17);Write(totaltime:6:2);
  110.       Gotoxy(16,18);Write(macro)
  111.     End
  112.    End;
  113.  
  114.  
  115. Procedure Open_Rec;
  116.     Begin
  117.       Assign(Infile,'USERS');
  118.       Reset(Infile);
  119.       Counter:=0;
  120.       While not eof (Infile) do Begin
  121.         Read(Infile,userrecs);
  122.         Counter:=Counter+1
  123.       end;
  124.       UserNum:=1
  125.     end;
  126.  
  127.  Procedure Write_Rec;
  128.  Begin
  129.    Seek(Infile,Usernum);
  130.    Write(Infile,UserRecs)
  131.  End;
  132.  
  133. Procedure Format_Data_Area;
  134.     Begin
  135.      For A:=2 to 20 do begin
  136.          GotoXy(16,A);Write('                                   ');
  137.          End;
  138.     Gotoxy(69,15);Write('   ');
  139.     Gotoxy(57,17);Write('            ');
  140.     End;
  141.  
  142. Procedure Delete_Rec;
  143.     Begin
  144.     With Userrecs do
  145.     Begin
  146.      Nbu:=0;
  147.      Handle:='';
  148.      Note:='';
  149.      Password:='';
  150.      Level:=0;
  151.      Udlevel:=0;
  152.      Phonenum:='';
  153.      TimeToday:=0;
  154.      Udpoints:=0;
  155.      Upk:=0;
  156.      Downk:=0;
  157.      Uploads:=0;
  158.      Downloads:=0;
  159.      Write_Rec;
  160.      List_Rec;
  161.      Gflevel:=0;
  162.      Gfuploads:=0;
  163.      Gfdownloads:=0;
  164.      TotalTime:=0;
  165.      Macro1:=''
  166.   end;
  167.   Write_Rec;
  168.   Format_Data_Area;
  169.   List_Rec
  170.  End;
  171.  
  172.  
  173. Procedure Add_Rec;
  174.    Begin
  175.     Usernum:=Counter;
  176.     Counter:=Counter+1;
  177.     GotoXy(57,15);Write('UserNubmer: ',Usernum);
  178.     With UserRecs do
  179.     Begin
  180.       nbu:=0;
  181.       Gotoxy(16,2);Readln(Handle);
  182.       Gotoxy(16,3);Readln(Note);
  183.       Gotoxy(16,4);Readln(password);
  184.       Gotoxy(16,5);Readln(level);
  185.       Gotoxy(16,6);Readln(udlevel);
  186.       Gotoxy(16,7);Readln(phonenum);
  187.       Gotoxy(16,8);Readln(timetoday);
  188.       Gotoxy(16,9);Readln(udpoints);
  189.       Gotoxy(16,10);Readln(upk);
  190.       Gotoxy(16,11);Readln(Downk);
  191.       Gotoxy(16,12);Readln(uploads);
  192.       Gotoxy(16,13);Readln(downloads);
  193.       Gotoxy(16,14);Readln(gflevel);
  194.       Gotoxy(16,15);Readln(gfuploads);
  195.       Gotoxy(16,16);Readln(gfdownloads);
  196.       Gotoxy(16,17);Readln(totaltime);
  197.       Gotoxy(16,18);Readln(macro)
  198.     End
  199.     Seek(Infile,usernum);
  200.     Write(Infile,UserRecs)
  201.    End;
  202.  
  203.  
  204. Begin
  205.   ClrScr;
  206.   A:=0;
  207.   B:=0;
  208.   C:=0;
  209.   d:=0;
  210.   Flag:=False;
  211.   TextColor(11);
  212.   Gotoxy(1,1);
  213.   Write('┌────────────┐');
  214.   For A:=2 to 20 do Begin
  215.     Gotoxy(1,a);
  216.     Write('│            │')
  217.   End;
  218.   Gotoxy(1,21);
  219.   Write('└────────────┘');
  220.   TextColor(10);
  221.   Gotoxy(15,1);
  222.   Write('┌───────────────────────────────────┐');
  223.   For A:=2 to 20 do Begin
  224.     Gotoxy(15,a);
  225.     Write('│                                   │')
  226.   End;
  227.   Gotoxy(15,21);
  228.   Write('└───────────────────────────────────┘');
  229.   Show_Fields;
  230.   TextColor(14);
  231.   Gotoxy(1,22);
  232.   Write('┌');For a:=2 to 79 do Begin
  233.      Gotoxy(a,22);
  234.      Write('─')
  235.   End;
  236.   Gotoxy(80,22);
  237.   Write('┐');
  238.   TextColor(12);
  239.   Write('    [Q] Quit            [PageUp] Next User          [PageDown] Previous User');
  240.   TextColor(14);
  241.   Gotoxy(1,23);
  242.   Write('│');
  243.   Gotoxy(80,23);
  244.   Write('│');
  245.   Gotoxy(1,24);
  246.   Write('└');
  247.   For a:=2 to 79 do Begin
  248.     Gotoxy(a,24);
  249.     Write('─')
  250.   End;
  251.   Gotoxy(80,24);
  252.   Write('┘');
  253.   TextColor(11);
  254.   gotoxy(55,1);
  255.   Write('┌─────────────────┐');
  256.   For A:=2 to 10 do Begin
  257.     Gotoxy(55,a);
  258.     Write('│                 │')
  259.   End;
  260.   Gotoxy(55,10);
  261.   Write('└─────────────────┘');
  262.   TextColor(10);
  263.   Gotoxy(57,2);
  264.   Write('TCS User Editor');
  265.   Gotoxy(57,3);
  266.   Write('Written by the');
  267.   Gotoxy(57,4);
  268.   Write('  TCS Staff');
  269.   Gotoxy(57,6);
  270.   Write('    v1.00 ');
  271.   TextColor(13);
  272.   Gotoxy(55,11);
  273.   Write('┌──────────────────┐');
  274.   For A:=12 to 20 do Begin
  275.     Gotoxy(55,a);
  276.     Write('│                  │')
  277.   End;
  278.   Gotoxy(55,20);
  279.   Write('└──────────────────┘');
  280.   TextColor(8);
  281.   Gotoxy(57,12);
  282.   Write('[A] Add User');
  283.   Gotoxy(57,13);
  284.   Write('[D] Delete User');
  285.   Gotoxy(57,19);
  286.   Write('[ESC] to Quit');
  287.   Open_Rec;
  288.   Format_Data_Area;
  289.   List_Rec;
  290.   Place:=1;
  291.   Place_Cursor;
  292.   While Flag=False do Begin
  293.     Choice:=Readkey;
  294.     Choice:=Upcase(Choice);
  295.     Case Choice of
  296.      'A':Begin
  297.            Format_Data_Area;
  298.            Add_Rec
  299.          End;
  300.      'D':Begin
  301.            Gotoxy(57,17);
  302.            Write('Delete User?');
  303.            Choice:=Readkey;
  304.            Choice:=Upcase(Choice);
  305.            If Choice='Y' then delete_rec else Begin
  306.              Gotoxy(57,17);
  307.              Write('             ')
  308.            End
  309.          End;
  310.      'Q':Begin
  311.            Write_Rec;
  312.            Close(Infile);
  313.            ClrScr;
  314.            Halt
  315.          End;
  316.      #27:Begin
  317.            Write_Rec;
  318.            Close(Infile);
  319.            ClrScr;
  320.            Halt
  321.          End;
  322.      #13:Read_Cursor;
  323.      #0:Begin
  324.           Choice:=Readkey;
  325.           Case Choice of
  326.            #73:Begin
  327.                  Write_Rec;
  328.                  Usernum:=Usernum+1;
  329.                  If Usernum>=counter then Usernum:=1;
  330.                  Format_Data_Area;
  331.                  List_Rec
  332.                End;
  333.            #81:Begin
  334.                  Write_Rec;
  335.                  Usernum:=Usernum-1;
  336.                  If Usernum<1 then usernum:=Counter-1;
  337.                  Format_Data_Area;
  338.                  List_Rec
  339.                End;
  340.            #72:Begin
  341.                  Place:=Place-1;
  342.                  if Place<1 then place:=19;
  343.                  Show_Fields;
  344.                  Place_Cursor
  345.                End;
  346.            #80:Begin
  347.                  Place:=Place+1;
  348.                  If Place>19 then place:=1;
  349.                  Show_Fields;
  350.                  Place_Cursor
  351.                End
  352.         End
  353.      End
  354.   End
  355. End
  356. End.