home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / LABELS / LABELS2.PAS
Encoding:
Pascal/Delphi Source File  |  1990-01-02  |  2.7 KB  |  122 lines

  1. {A first attempt at a TURBO PASCAL program. Any comments would be welcome!!
  2.   Contact Debbie Hardin, 44 Cedar Drive, Sterling,VA 22170 or leave a message
  3.     on TECHMAIL BBS (703)450-4270}
  4.  
  5. {= = = = = = = = = = = = = = = = = = =}
  6. {  Version 0.02 & comments by MXM,SJ  }
  7. {= = = = = = = = = = = = = = = = = = =}
  8. {= = = = = = = = = = = = = = = = = = =}
  9. {     4 September 1985 02:22:00       }
  10. {= = = = = = = = = = = = = = = = = = =}
  11.  
  12. (* * * * * * * *)
  13.  Program Labels;  {A program to print file folder labels}
  14. (* * * * * * * *)
  15.  
  16.  
  17. Uses
  18.   Crt,
  19.   Printer;
  20.  
  21. type
  22.   str20 = string[20];
  23.   str40 = string[40];
  24.  
  25. const
  26.   Done   : Boolean = False;
  27.   norm_eps_char  = #27#70#27#72#27#18;
  28.   small_eps_char = #27#69#27#71;
  29.   SO    = #14;
  30.   SI    = #15;
  31.  
  32. var
  33.   Line1 : str20;
  34.   Line2 : str40;
  35.  
  36. {---------------------------------------}
  37.  function sezYes: Boolean;
  38. {---------------------------------------}
  39. var
  40.   Ch: char; { changed from parameter to local variable - DSMB }
  41. begin
  42.     Ch := readkey;
  43.     writeln(Ch);
  44.  
  45.     Ch := upcase(Ch);
  46.     if Ch = 'Y'
  47.       then sezYes := True
  48.       else sezYes := False;
  49.  
  50. end; {ask a yes/no question, get a yes/no/character answer}
  51.  
  52. {----------------}
  53.  Procedure Input;  {Take input from keyboard for labels}
  54. {----------------}
  55.  
  56. begin
  57.   clrscr;
  58.   gotoxy(10,10);
  59.   writeln('Please turn printer on and align labels.');
  60.   writeln;
  61.   writeln;
  62.   writeln('Enter the first line for the label...');
  63.   readln(Line1);
  64.   writeln;
  65.   writeln('Enter the second line for the label...');
  66.   readln(Line2);
  67.   writeln;
  68.   clrscr;
  69.   gotoxy(10,10);
  70.   writeln(Line1);
  71.   gotoxy(10,12);
  72.   writeln(Line2);
  73.   writeln;
  74.   writeln;
  75. end; {input}
  76.  
  77. {----------------}
  78.  Procedure Print; {Print input taken from keyboard on labels on printer}
  79. {----------------}
  80.  
  81. begin
  82.   writeln(lst,small_eps_char);
  83.   writeln(lst,SO,Line1,SI);
  84.   writeln(lst);
  85.   writeln(lst,Line2);
  86.   writeln(lst);
  87.   writeln(lst);
  88. end; {print}
  89.  
  90. {----------------------}
  91.  Procedure Label_Check;  {Verify label info before printing}
  92. {----------------------}
  93.  
  94. begin
  95.   writeln('Is this the label you want? (Y/N)');
  96.   if sezYes then Print;
  97. end; {check the label before printing}
  98.  
  99. {---------------------}
  100.  Procedure Done_Check;  {Repeat program for all labels wanted}
  101. {---------------------}
  102.  
  103. begin
  104.   clrscr; gotoxy(10,10); writeln('Do you want another label?');
  105.   if sezYes
  106.     then done := false
  107.     else done := true;
  108. end; {All done?}
  109.  
  110. {--------------------------- Program Area -----------------------------}
  111.  
  112. begin {main body of program "Labels"}
  113.   while not Done do
  114.     begin
  115.       Input;
  116.       Label_Check;
  117.       Done_Check;
  118.     end; {do}
  119. writeln(lst,norm_eps_char);
  120. end.
  121. 
  122.