Program FiveLineLabel; {A program which requests 5 lines, centers them, and prints the 5 lines on a 1.5 x 4 label} var A,I: Integer; Ans: Char; Line:Array [1..5] of String[40]; {Change String size to fit} Offset:Array [1..5] of Integer; {length accommodated by the} {print mode you select} Label Start; Begin clrscr; writeln('5LNLABEL by Alan R. Therrien, Bergen/Rockland KUG '); writeln; writeln('Distribution of this program for profit is strictly PROHIBITED '); writeln; writeln; writeln('This program allows you to enter five lines of text (up to '); writeln('forty characters long) which are then centered and printed '); writeln('on 1.5" x 4" labels. You must use CAPS LOCK if you want '); writeln('your labels printed in all upper case letters. '); writeln; writeln; writeln; writeln; writeln('Press any Key to Continue. '); repeat until keypressed; Start: Clrscr; For I:= 1 to 5 do begin repeat writeln('Enter Line # ',I,' (up to 40 characters), or ''Q'' to quit. '); readln(Line[I]); until Length(Line[I])<40; {Change to match String length above} If (Line[I]='Q') or (Line[I]='q') then Bios(0); end; writeln; writeln; writeln('Turn Printer ON and Adjust Labels '); writeln('Hit Any Key to Continue '); repeat until keypressed; For I:= 1 to 5 do begin Offset[I]:=(40-Length(Line[I]))div 2; {Change 40 to match above} A:=1; Repeat Write(Lst,Chr(32)); {Insert proper printer code after Lst} A:=A+1; {command} Until A>Offset[I]; WriteLn(Lst,Line[I]); end; Writeln(Lst); Writeln(Lst); Writeln(Lst); Writeln(Lst); Goto Start; End.