home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PC_CHECK.ZIP / PC-CHECK.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1984-09-16  |  43.9 KB  |  1,240 lines

  1. Program PC_Check;
  2.  
  3. {$C-}
  4.  
  5. {      PC-Check Copyright (c)  The Forbin Project and John Friel III
  6.  
  7.        PC-Check  is a checkbook and  savings  record  keeper  produced
  8.        by the  Forbin  Project.   Like some public domain software, we
  9.        are asking  for a  donation  for  the use  of this program.   A
  10.        donation of  only $5.00  is requested.   Those that  do  donate
  11.        will  receive  published announcements  for future enhancements
  12.        to  PC-Check  and other programs written by the Forbin Project.
  13.        PC-Check  may  be  transferred  to  other people  under two (2)
  14.        conditions;  that there is  NO CHARGE  for the copy(s) and that
  15.        the source program  not be modified in  any way, shape or form.
  16.        The user  may  modify  the source code  to suit his  or her own
  17.        personal tastes.    All rights reserved by the  Forbin Project.
  18.        Please keep an unmodified  copy  around just for  this purpose.
  19.        For  more  information  on  this  program  or   more   detailed
  20.        information  on interfacing  TURBO Pascal  with the  IBM PC  or
  21.        Compatibles, (this was developed on a Tava PC!) please write to
  22.        the Forbin Project at :
  23.  
  24.                           The Forbin Project
  25.                           John Friel III
  26.                           715 Walnut Street
  27.                           Cedar Falls, Iowa  50613
  28. }
  29.  
  30. Const
  31.   blink_yes        = true;
  32.   blink_no         = false;
  33.   yes_no           : set of char = ['Y','y','N','n'];
  34.   filechars        : set of char = ['A'..'Z','a'..'z','0'..'9',':',
  35.                                     '!','$','@','#','%','-','&'];
  36.  
  37. type
  38.   check_trans  = (cdeposit, cwithdrawl, cinterest,
  39.                   sdeposit, swithdrawl, sinterest);
  40.   check_type   = record
  41.                    post_date : string[8];
  42.                    check_no  : integer;
  43.                    to_who    : string[40];
  44.                    amount    : real;
  45.                    memo      : string[30];
  46.                    check_tran: check_trans;
  47.                    cleared   : boolean;
  48.                  end;
  49.   Names            = String[80];
  50.   Screen_Array     = Array [1..4000] of byte;
  51.   months           = 1..12;
  52.   days             = 1..31;
  53.   years            = 0..99;
  54.   xxxstr80         = string[80];
  55.   xxxstr8          = string[8];
  56.   xxxfile          = file;
  57.  
  58. Var
  59.   st1, st2, st3                 : string[2];
  60.   n_amount,temp_date            : string[8];
  61.   n_check_num                   : string[5];
  62.   new_amount, amount_h          : real;
  63.   t_cdc, t_cwc, t_cic,
  64.   t_sdc, t_swc, t_sic,
  65.   t_cdu, t_cwu, t_ciu,
  66.   t_sdu, t_swu, t_siu,
  67.   tcc, tcs, rbs, rbc            : real;
  68.   rc, check_num_h               : integer;
  69.   month                         : months;
  70.   day                           : days;
  71.   year                          : years;
  72.   trnfile                       : file of check_type;
  73.   one_trn                       : check_type;
  74.   x, i, y, q, e, w, check_num   : Integer;
  75.   to_whom, to_who_h             : string[40];
  76.   new_memo, memo_h              : string[30];
  77.   Ok, bool, done, edit_ok       : Boolean;
  78.   FileName                      : Names;
  79.   Real_Screen                   : Screen_Array absolute $B800:$0000;
  80.   Temp_Screen, temp_Screen2     : Screen_Array;
  81.   Ch, ch1,ch2                   : Char;
  82.   check_tran_h                  : check_trans;
  83.  
  84.  
  85. function readdate(x,y:integer):xxxstr8;
  86. {  reads a string from the terminal from screen at position xy  }
  87. {    the string will contain a Valid date in format 00/00/00  }
  88. Var
  89.    hold : array [1..6] of char;
  90.    location : integer;
  91.    inchar : char;
  92.  
  93. begin
  94.    location := 1;
  95.    gotoxy(x,y);
  96.    write('  /  /  ');
  97.    gotoxy(x,y);
  98.    while location<8 do
  99.       begin
  100.          read(kbd,inchar);
  101.          case location of
  102.             1:
  103.                begin
  104.                   gotoxy(x,y);
  105.                   if inchar in ['1','0',' '] then
  106.                      begin
  107.                         hold[1] := inchar;
  108.                         write(inchar);
  109.                         location := 2;
  110.                         gotoxy((x+1),y);
  111.                      end
  112.                   else
  113.                      begin
  114.                         write(chr(7));
  115.                      end;
  116.                end;
  117.             2:
  118.                begin
  119.                   gotoxy((x+1),y);
  120.                   if inchar in ['1'..'9','0'] then
  121.                      if hold[1]='1' then
  122.                         if inchar in ['1','2','0'] then
  123.                            begin
  124.                               hold[2] := inchar;
  125.                               write(inchar);
  126.                               location := 3;
  127.                            end
  128.                         else
  129.                            begin
  130.                               write(chr(7));
  131.                            end
  132.                      else
  133.                         begin
  134.                            write(inchar);
  135.                            hold[2] := inchar;
  136.                            location := 3;
  137.                         end
  138.                   else
  139.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  140.                         begin
  141.                            gotoxy(x,y);
  142.                            write(' ');
  143.                            location := 1;
  144.                            hold[1] := ' ';
  145.                            gotoxy(x,y);
  146.                         end
  147.                      else
  148.                         begin
  149.                            write(chr(7));
  150.                         end;
  151.                end;
  152.             3:
  153.                begin
  154.                   gotoxy((x+3),y);
  155.                   if inchar in ['1'..'3','0',' '] then
  156.                      begin
  157.                         hold[3] := inchar;
  158.                         write(inchar);
  159.                         location := 4;
  160.                         gotoxy((x+4),y);
  161.                      end
  162.                   else
  163.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  164.                         begin
  165.                            gotoxy((x+1),y);
  166.                            write(' ');
  167.                            location := 2;
  168.                            hold[2] := ' ';
  169.                            gotoxy((x+1),y);
  170.                         end
  171.                      else
  172.                         begin
  173.                            write(chr(7));
  174.                         end;
  175.                end;
  176.             4:
  177.                begin
  178.                   gotoxy((x+4),y);
  179.                   if inchar in ['1'..'9','0'] then
  180.                      begin
  181.                         hold[4] := inchar;
  182.                         write(inchar);
  183.                         location := 5;
  184.                         gotoxy((x+6),y);
  185.                      end
  186.                   else
  187.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  188.                         begin
  189.                            gotoxy((x+3),y);
  190.                            write(' ');
  191.                            location := 3;
  192.                            hold[3] := ' ';
  193.                            gotoxy((x+3),y);
  194.                         end
  195.                      else
  196.                         begin
  197.                            write(chr(7));
  198.                         end;
  199.                end;
  200.             5:
  201.                begin
  202.                   gotoxy((x+6),y);
  203.                   if inchar in ['1'..'9','0'] then
  204.                      begin
  205.                         hold[5] := inchar;
  206.                         write(inchar);
  207.                         location := 6;
  208.                         gotoxy((x+7),y);
  209.                      end
  210.                   else
  211.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  212.                         begin
  213.                            gotoxy((x+4),y);
  214.                            write(' ');
  215.                            location := 4;
  216.                            hold[4] := ' ';
  217.                            gotoxy((x+4),y);
  218.                         end
  219.                      else
  220.                         begin
  221.                            write(chr(7));
  222.                         end;
  223.                end;
  224.             6:
  225.                begin
  226.                   gotoxy((x+7),y);
  227.                   if inchar in ['1'..'9','0'] then
  228.                      begin
  229.                         hold[6] := inchar;
  230.                         write(inchar);
  231.                         location := 7;
  232.                      end
  233.                   else
  234.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  235.                         begin
  236.                            gotoxy((x+6),y);
  237.                            write(' ');
  238.                            location := 5;
  239.                            hold[5] := ' ';
  240.                            gotoxy((x+6),y);
  241.                         end
  242.                      else
  243.                         begin
  244.                            write(chr(7));
  245.                         end;
  246.                end;
  247.             7:
  248.                begin
  249.                   if ((inchar=chr(11)) or (inchar=chr(13))) then
  250.                      location := 8
  251.                   else
  252.                      if ((inchar=chr(8)) or (inchar=chr(7))) then
  253.                         begin
  254.                            gotoxy((x+7),y);
  255.                            write(' ');
  256.                            location := 6;
  257.                            hold[6] := ' ';
  258.                            gotoxy((x+7),y);
  259.                         end;
  260.                end;
  261.          end;
  262.       end;
  263.    readdate := hold[1]+hold[2]+'/'+hold[3]+hold[4]+'/'+hold[5]+hold[6];
  264. end;
  265.  
  266.  
  267. Procedure Big_exit;
  268. begin
  269.   close (trnfile);
  270.   textbackground(black);
  271.   textcolor(yellow);
  272.   window (1,1,80,25);
  273.   for x := 10 downto 1 do
  274.     for y := 2 downto 1 do
  275.       begin
  276.         window (x+y-1,x+4,82-x-y,25-x);
  277.         clrscr;
  278.         delay (5);
  279.       end;
  280.   gotoxy (29,12);
  281.   write ('PC-Check has Completed.');
  282.   halt;
  283. end;
  284.  
  285. Procedure Drawbox_IBM (x1,y1,x2,y2,FG,BG : Integer; boxname : Names; blnk : boolean);
  286. Begin
  287.   window (x1,y1,x2,y1+1);
  288.   textbackground(BG);
  289.   GotoXY(1,1);
  290.   x := x2-x1;
  291.   if length(boxname) > x then boxname[0] := chr(x-4);
  292.   textcolor(FG);
  293.   Write('╒');
  294.   if blnk then textcolor(FG + blink) else textcolor(fg);
  295.   write (boxname);
  296.   textcolor(FG);
  297.   for q := x1+length(boxname)+1 to x2-1 do Write('═');
  298.   Write('╕');
  299.   for q := 2 to y2-y1 do
  300.     Begin
  301.       window (x1,y1,x2,y1+q+1);
  302.       GotoXY(1,q); Write('│');
  303.       if blnk then clreol;
  304.       GotoXY(x2-x1+1,q); Write('│');
  305.     end;
  306.   Window(x1,y1,x2,y2+1);
  307.   gotoXY(1,y2-y1+1);
  308.   Write('╘');
  309.   for q := x1+1 to x2-1 do Write('═');
  310.   Write('╛');
  311. end;
  312.  
  313. Procedure Drawbox (x1,y1,x2,y2,FG,BG : Integer; boxname : Names; blnk : boolean);
  314. Begin
  315.   Drawbox_IBM (x1,y1,x2,y2,FG,BG,boxname,blnk);
  316.   Window (x1+1,y1+1,x2-1,y2-1);
  317.   Clrscr;
  318. end;
  319.  
  320.  
  321. Procedure Init;
  322. Begin
  323.   textcolor(white);
  324.   done := False;
  325.   Window (1,1,80,25);
  326.   ClrScr;
  327.   Drawbox (1,1,80,4,lightgreen,black,'',blink_yes);
  328.   textcolor(yellow);
  329.   assign (trnfile,'dummy');
  330.   Writeln ('                                 PC-Check');
  331.   Write   ('     (c) The Forbin Project   1 September 1984   Using TURBO Pascal');
  332. end;
  333.  
  334. procedure open_files;
  335. var
  336.   file_ok,colon : boolean;
  337. begin
  338.   Drawbox (1,5,80,14,yellow,red,'[ File Allocation ]',blink_yes);
  339.   close (trnfile);
  340.   repeat
  341.     writeln;
  342.     write  ('Enter Transaction file name  (x:xxxxxxxx)  ');
  343.     buflen := 10;
  344.     readln (filename);
  345.     file_ok := true;
  346.     colon := false;
  347.     ok := false;
  348.     for q := 1 to length(filename) do
  349.       begin
  350.         if not (filename[q] in filechars) then
  351.           file_ok := false;
  352.         if (filename[q] = ':') and (q <> 2) then
  353.           file_ok := false;
  354.         if filename[q] = ':' then colon := true;
  355.       end;
  356.     if (not colon) and (length(filename) > 8) then file_ok := false;
  357.     if colon and (length(filename) < 3) then file_ok := false;
  358.     if (length(filename) <> 0) and file_ok then
  359.       begin
  360.         filename := filename + '.CHK';
  361.         assign (trnfile, filename);
  362.         {$I-} reset (trnfile); {$I+}
  363.         ok := (ioresult = 0);
  364.         if not ok then
  365.           begin
  366.             write ('File does not exist. create it  (Y/N) ? ');
  367.             repeat
  368.               read (kbd, ch);
  369.             until ch in yes_no;
  370.             if ch in ['Y','y'] then
  371.               begin
  372.                 ok := true;
  373.                 rewrite (trnfile);
  374.               end
  375.           end;
  376.       end
  377.     else
  378.       begin
  379.         ok := false;
  380.         write ('Invalid filename. Do you want to Quit ? ');
  381.         repeat read (kbd, ch); until ch in yes_no;
  382.         if ch in ['Y','y'] then big_exit;
  383.         writeln;
  384.       end;
  385.   until ok;
  386.   Drawbox_ibm (1,5,80,14,yellow,red,'[ File Allocation ]',blink_no);
  387. end;
  388.  
  389. procedure CD;
  390. begin
  391.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Deposit ]',blink_yes);
  392.   repeat
  393.     textcolor (white);
  394.     gotoxy (5,1);   write ('Date');
  395.     gotoxy (5,3);  write ('Amount ________');
  396.     gotoxy (5,5);   write ('Memo ______________________________');
  397.     { get date }
  398.     textcolor (lightcyan);
  399.     repeat
  400.       temp_date := readdate(10,1);
  401.       { get amount }
  402.       repeat
  403.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  404.         val (n_amount, new_amount, rc);
  405.         if rc <> 0 then
  406.           begin
  407.             gotoxy (5,7);
  408.             writeln ('Error in Amount at position ',rc:1);
  409.           end;
  410.       until rc = 0;
  411.       gotoxy (5,7); clreol;
  412.       { get memo }
  413.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  414.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  415.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  416.       repeat
  417.         read (kbd, ch);
  418.       until ch in yes_no;
  419.       case ch of
  420.         'N','n'  :  begin
  421.                       gotoxy (5,7); clreol;
  422.                       write ('Do you want to EXIT (Y/N) ? ');
  423.                       repeat
  424.                         read (kbd, ch1);
  425.                       until ch1 in yes_no;
  426.                     end;
  427.         'Y','y'  :  ch1 := 'N';
  428.       end; { case }
  429.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  430.     if ch in ['Y','y'] then
  431.       begin
  432.         with one_trn do
  433.           begin
  434.             post_date := temp_date;
  435.             check_no  := 0;
  436.             to_who    := '                                         ';
  437.             amount    := new_amount;
  438.             memo      := new_memo;
  439.             check_tran := cdeposit;
  440.             cleared    := false;
  441.           end; { with }
  442.         seek (trnfile, filesize(trnfile));
  443.         write (trnfile, one_trn);
  444.       end;
  445.     gotoxy (5,7); clreol;
  446.     write ('Do you want to EXIT (Y/N)  ');
  447.     repeat
  448.       read (kbd, ch1);
  449.     until ch1 in yes_no;
  450.   until ch1 in ['y','Y'];
  451. end;
  452.  
  453. procedure CW;
  454. begin
  455.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Withdrawl  --  Blank Check ]',blink_yes);
  456.   repeat
  457.     textcolor (white);
  458.     gotoxy (5,1);   write ('Date');
  459.     gotoxy (60,1);  write ('Check Number _____');
  460.     gotoxy (5,3);   write ('Pay to ________________________________________');
  461.     gotoxy (60,3);  write ('Amount ________');
  462.     gotoxy (5,5);   write ('Memo ______________________________');
  463.     { get date }
  464.     textcolor (lightcyan);
  465.     repeat
  466.       temp_date := readdate(10,1);
  467.       { get check number }
  468.       repeat
  469.         gotoxy (73,1);  buflen := 5;  readln (n_check_num);
  470.         val (n_check_num, check_num, rc);
  471.         if rc <> 0 then
  472.           begin
  473.             gotoxy (5,7);
  474.             writeln ('Error : Numeric input only.');
  475.           end;
  476.       until rc = 0;
  477.       gotoxy (5,7); clreol;
  478.       { get to_who }
  479.       gotoxy (12,3);  buflen := 40; readln (to_whom);
  480.       { get amount }
  481.       repeat
  482.         gotoxy (67,3);  buflen := 8;  readln (n_amount);
  483.         val (n_amount, new_amount, rc);
  484.         if rc <> 0 then
  485.           begin
  486.             gotoxy (5,7);
  487.             writeln ('Error in Amount at position ',rc:1);
  488.           end;
  489.       until rc = 0;
  490.       gotoxy (5,7); clreol;
  491.       { get memo }
  492.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  493.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  494.       while length(to_whom) < 40 do to_whom := to_whom + ' ';
  495.       gotoxy (5,7);   write ('Is this check right  (Y/N)  ');
  496.       repeat
  497.         read (kbd, ch);
  498.       until ch in yes_no;
  499.       case ch of
  500.         'N','n'  :  begin
  501.                       gotoxy (5,7);
  502.                       write ('Do you want to EXIT (Y/N)  ');
  503.                       repeat
  504.                         read (kbd, ch1);
  505.                       until ch1 in yes_no;
  506.                     end;
  507.         'Y','y'  :  ch1 := 'N';
  508.       end; { case }
  509.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  510.     if ch in ['Y','y'] then
  511.       begin
  512.         with one_trn do
  513.           begin
  514.             post_date := temp_date;
  515.             check_no  := check_num;
  516.             to_who    := to_whom;
  517.             amount    := new_amount;
  518.             memo      := new_memo;
  519.             check_tran := cwithdrawl;
  520.             cleared    := false;
  521.           end; { with }
  522.         seek (trnfile, filesize(trnfile));
  523.         write (trnfile, one_trn);
  524.       end;
  525.     gotoxy (5,7);
  526.     write ('Do you want to EXIT (Y/N)  ');
  527.     repeat
  528.       read (kbd, ch1);
  529.     until ch1 in yes_no;
  530.   until ch1 in ['y','Y'];
  531. end;
  532.  
  533. procedure CI;
  534. begin
  535.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Interest Deposit ]',blink_yes);
  536.   repeat
  537.     textcolor (white);
  538.     gotoxy (5,1);  write ('Date');
  539.     gotoxy (5,3);  write ('Amount ________');
  540.     { get date }
  541.     textcolor (lightcyan);
  542.     repeat
  543.       temp_date := readdate(10,1);
  544.       { get amount }
  545.       repeat
  546.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  547.         val (n_amount, new_amount, rc);
  548.         if rc <> 0 then
  549.           begin
  550.             gotoxy (5,7);
  551.             writeln ('Error in Amount at position ',rc:1);
  552.           end;
  553.       until rc = 0;
  554.       gotoxy (5,7); clreol;
  555.       gotoxy (5,7);   write ('Is this right  (Y/N)  ');
  556.       repeat
  557.         read (kbd, ch);
  558.       until ch in yes_no;
  559.       case ch of
  560.         'N','n'  :  begin
  561.                       gotoxy (5,7);
  562.                       write ('Do you want to EXIT (Y/N)  ');
  563.                       repeat
  564.                         read (kbd, ch1);
  565.                       until ch1 in yes_no;
  566.                     end;
  567.         'Y','y'  :  ch1 := 'N';
  568.       end; { case }
  569.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  570.     if ch in ['Y','y'] then
  571.       begin
  572.         with one_trn do
  573.           begin
  574.             post_date := temp_date;
  575.             check_no  := 0;
  576.             to_who    := '                                         ';
  577.             amount    := new_amount;
  578.             memo      := 'Checking Interest              ';
  579.             check_tran := cinterest;
  580.             cleared    := false;
  581.           end; { with }
  582.         seek (trnfile, filesize(trnfile));
  583.         write (trnfile, one_trn);
  584.       end;
  585.     gotoxy (5,7);
  586.     write ('Do you want to EXIT (Y/N)  ');
  587.     repeat
  588.       read (kbd, ch1);
  589.     until ch1 in yes_no;
  590.   until ch1 in ['y','Y'];
  591. end;
  592.  
  593. procedure SD;
  594. begin
  595.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Deposit ]',blink_yes);
  596.   repeat
  597.     textcolor (white);
  598.     gotoxy (5,1);   write ('Date');
  599.     gotoxy (5,3);   write ('Amount ________');
  600.     gotoxy (5,5);   write ('Memo ______________________________');
  601.     { get date }
  602.     textcolor (lightcyan);
  603.     repeat
  604.       temp_date := readdate(10,1);
  605.       { get amount }
  606.       repeat
  607.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  608.         val (n_amount, new_amount, rc);
  609.         if rc <> 0 then
  610.           begin
  611.             gotoxy (5,7);
  612.             writeln ('Error in Amount at position ',rc:1);
  613.           end;
  614.       until rc = 0;
  615.       gotoxy (5,7); clreol;
  616.       { get memo }
  617.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  618.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  619.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  620.       repeat
  621.         read (kbd, ch);
  622.       until ch in yes_no;
  623.       case ch of
  624.         'N','n'  :  begin
  625.                       gotoxy (5,7); clreol;
  626.                       write ('Do you want to EXIT (Y/N) ? ');
  627.                       repeat
  628.                         read (kbd, ch1);
  629.                       until ch1 in yes_no;
  630.                     end;
  631.         'Y','y'  :  ch1 := 'N';
  632.       end; { case }
  633.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  634.     if ch in ['Y','y'] then
  635.       begin
  636.         with one_trn do
  637.           begin
  638.             post_date := temp_date;
  639.             check_no  := 0;
  640.             to_who    := '                                         ';
  641.             amount    := new_amount;
  642.             memo      := new_memo;
  643.             check_tran := sdeposit;
  644.             cleared    := false;
  645.           end; { with }
  646.         seek (trnfile, filesize(trnfile));
  647.         write (trnfile, one_trn);
  648.       end;
  649.     gotoxy (5,7); clreol;
  650.     write ('Do you want to EXIT (Y/N)  ');
  651.     repeat
  652.       read (kbd, ch1);
  653.     until ch1 in yes_no;
  654.   until ch1 in ['y','Y'];
  655. end;
  656.  
  657. procedure SW;
  658. begin
  659.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Withdrawl ]',blink_yes);
  660.   repeat
  661.     textcolor (white);
  662.     gotoxy (5,1);   write ('Date');
  663.     gotoxy (5,3);   write ('Amount ________');
  664.     gotoxy (5,5);   write ('Memo ______________________________');
  665.     { get date }
  666.     textcolor (lightcyan);
  667.     repeat
  668.       temp_date := readdate(10,1);
  669.       { get amount }
  670.       repeat
  671.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  672.         val (n_amount, new_amount, rc);
  673.         if rc <> 0 then
  674.           begin
  675.             gotoxy (5,7);
  676.             writeln ('Error in Amount at position ',rc:1);
  677.           end;
  678.       until rc = 0;
  679.       gotoxy (5,7); clreol;
  680.       { get memo }
  681.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  682.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  683.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  684.       repeat
  685.         read (kbd, ch);
  686.       until ch in yes_no;
  687.       case ch of
  688.         'N','n'  :  begin
  689.                       gotoxy (5,7); clreol;
  690.                       write ('Do you want to EXIT (Y/N) ? ');
  691.                       repeat
  692.                         read (kbd, ch1);
  693.                       until ch1 in yes_no;
  694.                     end;
  695.         'Y','y'  :  ch1 := 'N';
  696.       end; { case }
  697.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  698.     if ch in ['Y','y'] then
  699.       begin
  700.         with one_trn do
  701.           begin
  702.             post_date := temp_date;
  703.             check_no  := 0;
  704.             to_who    := '                                         ';
  705.             amount    := new_amount;
  706.             memo      := new_memo;
  707.             check_tran := swithdrawl;
  708.             cleared    := false;
  709.           end; { with }
  710.         seek (trnfile, filesize(trnfile));
  711.         write (trnfile, one_trn);
  712.       end;
  713.     gotoxy (5,7); clreol;
  714.     write ('Do you want to EXIT (Y/N)  ');
  715.     repeat
  716.       read (kbd, ch1);
  717.     until ch1 in yes_no;
  718.   until ch1 in ['y','Y'];
  719. end;
  720.  
  721. procedure SI;
  722. begin
  723.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Interest ]',blink_yes);
  724.   repeat
  725.     textcolor (white);
  726.     gotoxy (5,1);   write ('Date');
  727.     gotoxy (5,3);   write ('Amount ________');
  728.     gotoxy (5,5);   write ('Memo ______________________________');
  729.     { get date }
  730.     textcolor (lightcyan);
  731.     repeat
  732.       temp_date := readdate(10,1);
  733.       { get amount }
  734.       repeat
  735.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  736.         val (n_amount, new_amount, rc);
  737.         if rc <> 0 then
  738.           begin
  739.             gotoxy (5,7);
  740.             writeln ('Error in Amount at position ',rc:1);
  741.           end;
  742.       until rc = 0;
  743.       gotoxy (5,7); clreol;
  744.       { get memo }
  745.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  746.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  747.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  748.       repeat
  749.         read (kbd, ch);
  750.       until ch in yes_no;
  751.       case ch of
  752.         'N','n'  :  begin
  753.                       gotoxy (5,7); clreol;
  754.                       write ('Do you want to EXIT (Y/N) ? ');
  755.                       repeat
  756.                         read (kbd, ch1);
  757.                       until ch1 in yes_no;
  758.                     end;
  759.         'Y','y'  :  ch1 := 'N';
  760.       end; { case }
  761.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  762.     if ch in ['Y','y'] then
  763.       begin
  764.         with one_trn do
  765.           begin
  766.             post_date := temp_date;
  767.             check_no  := 0;
  768.             to_who    := '                                         ';
  769.             memo      := new_memo;
  770.             amount    := new_amount;
  771.             check_tran := sinterest;
  772.             cleared    := false;
  773.           end; { with }
  774.         seek (trnfile, filesize(trnfile));
  775.         write (trnfile, one_trn);
  776.       end;
  777.     gotoxy (5,7); clreol;
  778.     write ('Do you want to EXIT (Y/N)  ');
  779.     repeat
  780.       read (kbd, ch1);
  781.     until ch1 in yes_no;
  782.   until ch1 in ['y','Y'];
  783. end;
  784.  
  785. procedure Balance_sheet;    { the CHK file will be closed and reopened }
  786. var
  787.    tt : integer;
  788. begin
  789.   tt := 0;
  790.   t_cdc := 0.0; t_cwc := 0.0; t_cic := 0.0; t_sdc := 0.0;
  791.   t_swc := 0.0; t_sic := 0.0; t_cdu := 0.0; t_cwu := 0.0;
  792.   t_ciu := 0.0; t_sdu := 0.0; t_swu := 0.0; t_siu := 0.0;
  793.   tcc   := 0.0; tcs   := 0.0; rbs   := 0.0; rbc   := 0.0;
  794.   move (real_screen, temp_screen, 4000);
  795.   drawbox (2,6,79,23,white,black,'[ Balance Sheet ]',blink_yes);
  796.   gotoxy (27,2); write ('Deposits          Withdrawls          Interest');
  797.   gotoxy (1,3);  write ('Cleared');
  798.   gotoxy (3,4);  write ('Checking');
  799.   gotoxy (3,5);  write ('Savings');
  800.   gotoxy (1,7);  write ('Uncleared');
  801.   gotoxy (3,8);  write ('Checking');
  802.   gotoxy (3,9); write ('Savings');
  803.   gotoxy (25,11); write ('Checking            Savings');
  804.   gotoxy (3,13);  write ('Total Cleared');
  805.   gotoxy (4,14);  write ('Real Balance');
  806.   textcolor (lightgreen);
  807.   close (trnfile);                 { save buffered transactions }
  808.   assign (trnfile, filename);
  809.   reset (trnfile);
  810.   while not eof(trnfile) do
  811.     begin
  812.       read (trnfile, one_trn);
  813.       case one_trn.check_tran of
  814.         cdeposit    : if one_trn.cleared then
  815.                         t_cdc := t_cdc + one_trn.amount
  816.                       else
  817.                         t_cdu := t_cdu + one_trn.amount;
  818.         cwithdrawl  : if one_trn.cleared then
  819.                         t_cwc := t_cwc + one_trn.amount
  820.                       else
  821.                         t_cwu := t_cwu + one_trn.amount;
  822.         cinterest   : if one_trn.cleared then
  823.                         t_cic := t_cic + one_trn.amount
  824.                       else
  825.                         t_ciu := t_ciu + one_trn.amount;
  826.         sdeposit    : if one_trn.cleared then
  827.                         t_sdc := t_sdc + one_trn.amount
  828.                       else
  829.                         t_sdu := t_sdu + one_trn.amount;
  830.         swithdrawl  : if one_trn.cleared then
  831.                         t_swc := t_swc + one_trn.amount
  832.                       else
  833.                         t_swu := t_swu + one_trn.amount;
  834.         sinterest   : if one_trn.cleared then
  835.                         t_sic := t_sic + one_trn.amount
  836.                       else
  837.                         t_siu := t_siu + one_trn.amount;
  838.       end; { case }
  839.       tt := tt + 1;
  840.     end; { while }
  841.   tcc := t_cdc + t_cic - t_cwc;
  842.   tcs := t_sdc + t_sic - t_swc;
  843.   rbc := tcc + t_cdu + t_ciu - t_cwu;
  844.   rbs := tcs + t_sdu + t_siu - t_swu;
  845.   { now locate the totals on the screen }
  846.   gotoxy (25,4); write (t_cdc:8:2,'           ',t_cwc:8:2,'           ',t_cic:8:2);
  847.   gotoxy (25,5); write (t_sdc:8:2,'           ',t_swc:8:2,'           ',t_sic:8:2);
  848.   gotoxy (25,8); write (t_cdu:8:2,'           ',t_cwu:8:2,'           ',t_ciu:8:2);
  849.   gotoxy (25,9); write (t_sdu:8:2,'           ',t_swu:8:2,'           ',t_siu:8:2);
  850.   if tcc < 0 then textcolor (lightred);
  851.   gotoxy (25,13); write (tcc:8:2);
  852.   textcolor (lightgreen);
  853.   if tcs < 0 then textcolor (lightred);
  854.   gotoxy (44,13); write (tcs:8:2);
  855.   textcolor (lightgreen);
  856.   if rbc < 0 then textcolor (lightred);
  857.   gotoxy (25,14); write (rbc:8:2);
  858.   textcolor (lightgreen);
  859.   if rbs < 0 then textcolor (lightred);
  860.   gotoxy (44,14); write (rbs:8:2);
  861.   textcolor (lightblue);
  862.   gotoxy (5,16);  write ('Total Transaction = ',tt:4);
  863.   gotoxy (40,16); write ('Press any key to Return ');
  864.   read (kbd,ch);
  865.   move (temp_screen, real_screen, 4000);
  866. end;
  867.  
  868. procedure add_a_trn;
  869. begin
  870.   repeat
  871.     Drawbox (1,5,80,14,white,blue,'[ Transaction Menu ]',blink_yes);
  872.     writeln;
  873.     writeln ('Options:');
  874.     writeln ('        1)  Checking Deposit            4)  Savings Deposit');
  875.     writeln ('        2)  Checking Withdrawl          5)  Savings Withdrawl');
  876.     writeln ('        3)  Checking Interest           6)  Savings Interest');
  877.     writeln ('                                        7)  Exit');
  878.     write   ('                 Choice? ');
  879.     repeat
  880.       read (kbd, ch);
  881.     until ch in ['1'..'7'];
  882.     case ch of
  883.       '1'   :  CD;
  884.       '2'   :  CW;
  885.       '3'   :  CI;
  886.       '4'   :  SD;
  887.       '5'   :  SW;
  888.       '6'   :  SI;
  889.     end
  890.   until ch = '7';
  891.   Drawbox_ibm (1,5,80,14,white,blue,'[ Transaction Menu ]',blink_no);
  892. end;
  893.  
  894. procedure Clear_entries;
  895. var
  896.   tt, tc : integer;
  897. begin
  898.   tt := 0;  tc := 0;
  899.   move (real_screen, temp_screen, 4000);
  900.   drawbox (2,6,79,20,yellow,blue,'[ Clear Transactions ]',blink_yes);
  901.   close (trnfile);
  902.   assign (trnfile, filename);
  903.   reset (trnfile);
  904.   writeln ('    For every transaction displayed, ');
  905.   writeln ('    press ''Y'', ''N'' or ''Q''');
  906.   while not eof(trnfile) do
  907.     begin
  908.       read (trnfile, one_trn);
  909.       tt := tt + 1;
  910.       if not one_trn.cleared then
  911.         begin
  912.           gotoxy (20,5);
  913.           case one_trn.check_tran of
  914.             cdeposit  :  write ('Checking Deposit     ');
  915.             cwithdrawl  :  write ('Checking Withdrawl');
  916.             cinterest   :  write ('Checking Interest ');
  917.             sdeposit    :  write ('Savings Deposit   ');
  918.             swithdrawl  :  write ('Savings Withdrawl ');
  919.             sinterest   :  write ('Savings Interest  ');
  920.           end;  { case }
  921.           gotoxy (20,6);  write ('Posting Date : ',one_trn.post_date);
  922.           gotoxy (20,7);  write ('Check No.    : ',one_trn.check_no:5);
  923.           gotoxy (20,8);  write ('Written to   : ',one_trn.to_who);
  924.           gotoxy (20,9);  write ('Amount       : ',one_trn.amount:8:2);
  925.           gotoxy (20,10); write ('Memo         : ',one_trn.memo);
  926.           gotoxy (10,12); write ('Has this Cleared  [Yes, No, Quit] ? ');
  927.           repeat read (kbd, ch); until ch in yes_no + ['Q','q'];
  928.           if ch in ['Y','y'] then
  929.             begin
  930.               tc := tc + 1;
  931.               one_trn.cleared := true;
  932.               seek (trnfile, tt-1);
  933.               write (trnfile, one_trn);
  934.             end
  935.           else
  936.             if ch in ['Q','q'] then
  937.                while not eof(trnfile) do
  938.                  begin
  939.                    read (trnfile, one_trn);
  940.                    tt := tt + 1;
  941.                  end;
  942.         end;
  943.     end; { while }
  944.   clrscr;
  945.   writeln;
  946.   writeln ('    Total Transactions = ',tt:5);
  947.   writeln ('    Total Cleared      = ',tc:5);
  948.   write   ('    Press any key to Return ');
  949.   read (kbd,ch);
  950.   move (temp_screen, real_screen, 4000);
  951. end;  { clear_entries }
  952.  
  953. procedure Summary;
  954. var
  955.   tt, tc : integer;
  956. begin
  957.   tt := 0;  tc := 1;
  958.   move (real_screen, temp_screen, 4000);
  959.   drawbox (8,10,66,17,white,green,'[ Summary Print ]',blink_yes);
  960.   flush (trnfile);
  961.   reset (trnfile);
  962.   writeln;
  963.   writeln ('    Make sure your Printer is ON.');
  964.   writeln ('    Press ''Y'' to continue or any other key to Exit');
  965.   read (kbd, ch);
  966.   writeln;
  967.   if ch in ['Y','y'] then
  968.     begin
  969.       textcolor (yellow);
  970.       writeln ('    Printing Transaction File.');
  971.       write   ('    Press any key to Abort.');
  972.       writeln (lst,#15,#27,#85);
  973.       while not eof(trnfile) do
  974.         begin
  975.           if tt = 0 then
  976.             begin
  977.               for x := 1 to 3 do writeln (lst,'');
  978.               writeln (lst,'                     PC-Check  Summary sheet for transaction file ',filename,'      Page ',tc:2);
  979.               writeln (lst,'');
  980.               write   (lst,'Code    Cleared   Tran Date          Written                                Reason');
  981.               writeln (lst,'                         Amount   Check No.');
  982.               writeln (lst,'');
  983.               tt := 7;
  984.             end;
  985.           read (trnfile, one_trn);
  986.           tt := tt + 1;
  987.           write (lst,'  ');
  988.           case one_trn.check_tran of
  989.             cdeposit   : write (lst,'CD ');
  990.             cwithdrawl : write (lst,'CW ');
  991.             cinterest  : write (lst,'CI ');
  992.             sdeposit   : write (lst,'SD ');
  993.             swithdrawl : write (lst,'SW ');
  994.             sinterest  : write (lst,'SI ');
  995.           end;  { case }
  996.           if one_trn.cleared then
  997.             write (lst,'     Y')
  998.           else
  999.             write (lst,'     N');
  1000.           write (lst,'       ',one_trn.post_date:8);
  1001.           write (lst,'    ',one_trn.to_who:40);
  1002.           write (lst,'  ',one_trn.memo:30);
  1003.           write (lst,'  ',one_trn.amount:8:2);
  1004.           write (lst,'    ',one_trn.check_no:5);
  1005.           writeln (lst,'');
  1006.           if tt = 62 then
  1007.             begin
  1008.               for x := 1 to 4 do writeln (lst,'');
  1009.               tc := tc + 1;
  1010.               tt := 0;
  1011.             end;
  1012.           if keypressed then
  1013.             begin
  1014.               read (kbd, ch);
  1015.               seek (trnfile, filesize(trnfile));
  1016.             end;
  1017.       end; { while }
  1018.     end;
  1019.   move (temp_screen, real_screen, 4000);
  1020. end;
  1021.  
  1022. procedure Browse;
  1023. var
  1024.   tt, tc : integer;
  1025. begin
  1026.   tt := 0;  tc := 1;
  1027.   edit_ok := false;
  1028.   move (real_screen, temp_screen, 4000);
  1029.   drawbox (2,10,79,23,white,black,'[ Browse Transaction File  -- ' + filename + ']',blink_yes);
  1030.   flush (trnfile);
  1031.   reset (trnfile);
  1032.   tt := filesize(trnfile);
  1033.   textcolor (yellow);
  1034.   writeln ('    Valid keys are -');
  1035.   writeln ('    (F)irst (L)ast (N)ext (P)revious (Q)uit (E)dit');
  1036.   writeln ('    (+) Skip 10 Forward   (-) Skip 10 Back');
  1037.   repeat
  1038.     window (3,11,78,22);
  1039.     textcolor (Lightgray);
  1040.     gotoxy (20,4); write (' '); gotoxy (20,4);
  1041.     repeat read (kbd,ch); until ch in ['F','f','L','l','N','n','P','p','Q','q','+','-','E','e'];
  1042.     if ch in ['Q','q'] then
  1043.       begin end
  1044.     else
  1045.       begin
  1046.         case ch of
  1047.           'F','f'   :  begin
  1048.                          tc := 1;
  1049.                          seek (trnfile, tc - 1);
  1050.                        end;
  1051.           'L','l'   :  begin
  1052.                          tc := tt;
  1053.                          seek (trnfile, tc - 1);
  1054.                        end;
  1055.           'N','n'   :  begin
  1056.                          tc := tc + 1;
  1057.                          if tc > tt then tc := tt;
  1058.                          seek (trnfile, tc - 1);
  1059.                        end;
  1060.           'P','p'   :  begin
  1061.                          tc := tc - 1;
  1062.                          if tc = 0 then tc := 1;
  1063.                          seek (trnfile, tc - 1);
  1064.                        end;
  1065.           '+'       :  begin
  1066.                          tc := tc + 10;
  1067.                          if tc > tt then tc := tt;
  1068.                          seek (trnfile, tc - 1);
  1069.                        end;
  1070.           '-'       :  begin
  1071.                          tc := tc - 10;
  1072.                          if tc <= 0 then tc := 1;
  1073.                          seek (trnfile, tc - 1);
  1074.                        end;
  1075.           'E','e'   :  begin
  1076.                          if edit_ok then
  1077.                            begin
  1078.                              move (real_screen, temp_screen2, 4000);
  1079.                              drawbox (15,6,74,14,lightred+blink,black,'[ EDIT Tran ]',blink_yes);
  1080.                              check_num_h := one_trn.check_no;
  1081.                              to_who_h := one_trn.to_who;
  1082.                              amount_h := one_trn.amount;
  1083.                              memo_h := one_trn.memo;
  1084.                              check_tran_h := one_trn.check_tran;
  1085.                              repeat
  1086.                                textcolor (lightgreen);
  1087.                                gotoxy (2,1);
  1088.                                case one_trn.check_tran of
  1089.                                  cdeposit    :  write ('Checking Deposit     ');
  1090.                                  cwithdrawl  :  write ('Checking Withdrawl');
  1091.                                  cinterest   :  write ('Checking Interest ');
  1092.                                  sdeposit    :  write ('Savings Deposit   ');
  1093.                                  swithdrawl  :  write ('Savings Withdrawl ');
  1094.                                  sinterest   :  write ('Savings Interest  ');
  1095.                                end;  { case }
  1096.                                gotoxy (2,2);  write ('Posting Date : ',one_trn.post_date);
  1097.                                gotoxy (2,3);  write ('Check No.    : ',one_trn.check_no:1,'        ');
  1098.                                gotoxy (2,4);  write ('Written to   : ',one_trn.to_who);
  1099.                                gotoxy (2,5);  write ('Amount       : ',one_trn.amount:1:2,'        ');
  1100.                                gotoxy (2,6);  write ('Memo         : ',one_trn.memo);
  1101.                                { get date }
  1102.                                textcolor (lightcyan);
  1103.                                repeat
  1104.                                  temp_date := readdate(17,2);
  1105.                                  { get check number }
  1106.                                  repeat
  1107.                                    gotoxy (17,3);  buflen := 5;  readln (n_check_num);
  1108.                                    val (n_check_num, check_num, rc);
  1109.                                    if rc <> 0 then
  1110.                                      begin
  1111.                                        gotoxy (5,7);
  1112.                                        writeln ('Error : Numeric input only.');
  1113.                                      end;
  1114.                                  until rc = 0;
  1115.                                  gotoxy (5,7); clreol;
  1116.                                  if check_num = 0 then check_num := check_num_h;
  1117.                                  { get to_who }
  1118.                                  gotoxy (17,4);  buflen := 40; readln (to_whom);
  1119.                                  if to_whom = '' then to_whom := to_who_h;
  1120.                                  { get amount }
  1121.                                  repeat
  1122.                                    gotoxy (17,5);  buflen := 8;  readln (n_amount);
  1123.                                    if n_amount = '' then
  1124.                                      begin
  1125.                                        rc := 0;
  1126.                                        new_amount := amount_h
  1127.                                      end
  1128.                                    else
  1129.                                      begin
  1130.                                        val (n_amount, new_amount, rc);
  1131.                                        if rc <> 0 then
  1132.                                          begin
  1133.                                            gotoxy (5,7);
  1134.                                            writeln ('Error in Amount at position ',rc:1);
  1135.                                          end;
  1136.                                      end;
  1137.                                  until rc = 0;
  1138.                                  gotoxy (5,7); clreol;
  1139.                                  { get memo }
  1140.                                  gotoxy (17,6);  buflen := 30; readln (new_memo);
  1141.                                  if new_memo = '' then new_memo := memo_h;
  1142.                                  while length(new_memo) < 30 do new_memo := new_memo + ' ';
  1143.                                  while length(to_whom) < 40 do to_whom := to_whom + ' ';
  1144.                                  gotoxy (5,7);   write ('Is this check right  (Y/N)  ');
  1145.                                  repeat read (kbd, ch2); until ch2 in yes_no;
  1146.                                  case ch2 of
  1147.                                    'N','n'  :  begin
  1148.                                                  gotoxy (5,7);
  1149.                                                  write ('Do you want to EXIT (Y/N)  ');
  1150.                                                  repeat read (kbd, ch1); until ch1 in yes_no;
  1151.                                                end;
  1152.                                    'Y','y'  :  ch1 := 'N';
  1153.                                 end; { case }
  1154.                               until (ch2 in ['Y','y']) or (ch1 in ['Y','y']);
  1155.                               if ch2 in ['Y','y'] then
  1156.                                 begin
  1157.                                   with one_trn do
  1158.                                     begin
  1159.                                       post_date := temp_date;
  1160.                                       check_no  := check_num;
  1161.                                       to_who    := to_whom;
  1162.                                       amount    := new_amount;
  1163.                                       memo      := new_memo;
  1164.                                       check_tran := check_tran_h;
  1165.                                       cleared    := false;
  1166.                                     end; { with }
  1167.                                   seek (trnfile, tc - 1);
  1168.                                   write (trnfile, one_trn);
  1169.                                 end;
  1170.                                 gotoxy (5,7);
  1171.                               if ch1 in ['y','Y'] then
  1172.                                 begin end
  1173.                               else
  1174.                                 begin
  1175.                                   write ('Do you want to EXIT (Y/N)  ');
  1176.                                   repeat read (kbd, ch1); until ch1 in yes_no;
  1177.                                 end;
  1178.                              until ch1 in ['y','Y'];
  1179.                              move (temp_screen2, real_screen, 4000);
  1180.                            end
  1181.                        end
  1182.         end; { case }
  1183.         if ch in ['E','e'] then
  1184.           begin end
  1185.         else
  1186.           begin
  1187.             read (trnfile, one_trn);
  1188.             edit_ok := true;
  1189.             gotoxy (15,5); writeln ('Transaction Number ',tc:1,'        ');
  1190.             gotoxy (15,6);
  1191.             case one_trn.check_tran of
  1192.               cdeposit  :  write ('Checking Deposit     ');
  1193.               cwithdrawl  :  write ('Checking Withdrawl');
  1194.               cinterest   :  write ('Checking Interest ');
  1195.               sdeposit    :  write ('Savings Deposit   ');
  1196.               swithdrawl  :  write ('Savings Withdrawl ');
  1197.               sinterest   :  write ('Savings Interest  ');
  1198.             end;  { case }
  1199.             gotoxy (15,7);  write ('Posting Date : ',one_trn.post_date);
  1200.             gotoxy (15,8);  write ('Check No.    : ',one_trn.check_no:1,'        ');
  1201.             gotoxy (15,9);  write ('Written to   : ',one_trn.to_who);
  1202.             gotoxy (15,10); write ('Amount       : ',one_trn.amount:1:2,'        ');
  1203.             gotoxy (15,11); write ('Memo         : ',one_trn.memo);
  1204.           end;
  1205.       end;
  1206.   until ch in ['Q','q'];
  1207.   move (temp_screen, real_screen, 4000);
  1208. end;
  1209.  
  1210. procedure main_options;
  1211. begin
  1212.   repeat
  1213.     drawbox (1,15,80,24,lightcyan,black,'[ Main Menu ]',blink_yes);
  1214.     writeln (' Options :');
  1215.     writeln ('           1)  Add Transactions           4)  Show Balance Sheet');
  1216.     writeln ('           2)  Clear Transactions         5)  Print Summary ');
  1217.     writeln ('           3)  Change Transaction File    6)  Browse Transaction File');
  1218.     writeln ('                                          7)  Exit PC-Check');
  1219.     write   ('                  Your choice ? ');
  1220.     repeat
  1221.       read (kbd,ch);
  1222.     until ch in ['1'..'7'];
  1223.     drawbox_ibm (1,15,80,24,lightcyan,black,'[ Main Menu ]',blink_no);
  1224.     case ch of
  1225.       '1'      : Add_a_trn;
  1226.       '4'      : Balance_sheet;
  1227.       '2'      : clear_entries;
  1228.       '5'      : Summary;
  1229.       '3'      : open_files;
  1230.       '6'      : Browse;
  1231.       '7'      : big_exit;
  1232.     end;
  1233.   until done;
  1234. end;
  1235.  
  1236. begin    {Check_book}
  1237.   init;
  1238.   open_files;
  1239.   main_options;
  1240. end.