home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progpas / tspas18.arj / TSUNTF.TST < prev    next >
Text File  |  1989-12-02  |  1KB  |  57 lines

  1. (* This is a test program for the TSUNTF.TPU unit
  2.    All rights reserved 19-Aug-89
  3.    Updated 23-Sep-89
  4. *)
  5.  
  6. uses Dos,
  7.      Crt,
  8.      TSUNTF;
  9.  
  10. procedure LOGO;
  11. begin
  12.   writeln;
  13.   writeln ('TSUNTF unit test by Prof. Timo Salmi, 4-Sep-89');
  14.   writeln ('University of Vaasa, Finland, ts@chyde.uwasa.fi');
  15.   writeln;
  16.   writeln ('....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....');
  17. end;  (* logo *)
  18.  
  19. (* Input line-editing *)
  20. procedure TEST1;
  21. var sj     : string;
  22.     prompt : string;
  23.     tmp    : string;
  24. begin
  25.   prompt := 'Give your input> ';
  26.   FillChar (tmp, SizeOf(tmp), '.');  { If you are wondering about these two, }
  27.   tmp[0] := chr(Length(prompt));     { they just produce points to show where}
  28.   repeat                             { we are.                               }
  29.     EDRDLN (prompt, sj);
  30.     writeln (tmp, sj);
  31.   until sj = 'exit';
  32. end;  (* test1 *)
  33.  
  34. (* Iput line-editing with recall potential *)
  35. procedure TEST2;
  36. var sj     : string;
  37.     old    : string;
  38.     prompt : string;
  39.     tmp    : string;
  40. begin
  41.   prompt := 'Give your input> ';
  42.   old := '';
  43.   repeat
  44.     EDREADLN (prompt, old, sj);
  45.     writeln (sj);
  46.     old := sj;
  47.   until sj = 'exit';
  48. end;  (* test2 *)
  49.  
  50. (* Main program *)
  51. begin
  52.   ClrScr;
  53.   LOGO;
  54.   { TEST1; }
  55.   TEST2;
  56. end.  (* tsuntf.tst *)
  57.