home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / PROGRAMS / LIST / FIVLNLBL.LBR / 5LNLABEL.PAS < prev   
Pascal/Delphi Source File  |  2000-06-30  |  2KB  |  63 lines

  1. Program            FiveLineLabel; {A program which requests 5 lines, centers
  2.                    them, and prints the 5 lines on a 1.5 x 4 label}
  3.  
  4. var                A,I: Integer;
  5.                    Ans: Char;
  6.  
  7.                    Line:Array [1..5] of String[40]; {Change String size to fit}
  8.                    Offset:Array [1..5]  of Integer; {length accommodated by the}
  9.                                                     {print mode you select}
  10. Label              Start;
  11.  
  12.  
  13. Begin
  14.      clrscr;
  15.      writeln('5LNLABEL by Alan R. Therrien,  Bergen/Rockland KUG ');
  16.      writeln;
  17.      writeln('Distribution of this program for profit is strictly PROHIBITED ');
  18.      writeln;
  19.      writeln;
  20.      writeln('This program allows you to enter five lines of text (up to ');
  21.      writeln('forty characters long) which are then centered and printed ');
  22.      writeln('on 1.5" x 4" labels.  You must use CAPS LOCK if you want ');
  23.      writeln('your labels printed in all upper case letters.  ');
  24.      writeln;
  25.      writeln;
  26.      writeln;
  27.      writeln;
  28.      writeln('Press any Key to Continue. ');
  29.      repeat until keypressed;
  30.  
  31. Start:
  32.      Clrscr;
  33.      For I:= 1 to 5 do
  34.      begin
  35.        repeat
  36.        writeln('Enter Line # ',I,' (up to 40 characters), or ''Q'' to quit. ');
  37.        readln(Line[I]);
  38.        until Length(Line[I])<40; {Change to match String length above}
  39.          If (Line[I]='Q') or (Line[I]='q') then Bios(0);
  40.      end;
  41.      writeln;
  42.      writeln;
  43.      writeln('Turn Printer ON and Adjust Labels ');
  44.      writeln('Hit Any Key to Continue ');
  45.      repeat until keypressed;
  46.           For I:= 1 to 5 do
  47.           begin
  48.                Offset[I]:=(40-Length(Line[I]))div 2; {Change 40 to match above}
  49.                A:=1;
  50.                Repeat
  51.                Write(Lst,Chr(32)); {Insert proper printer code after Lst}
  52.                A:=A+1;             {command}
  53.                Until A>Offset[I];
  54.                WriteLn(Lst,Line[I]);
  55.           end;
  56.      Writeln(Lst);
  57.      Writeln(Lst);
  58.      Writeln(Lst);
  59.      Writeln(Lst);
  60.  
  61. Goto Start;
  62. End.
  63.