Category : Printer Utilities
Archive   : HP4PAGE.ZIP
Filename : 4PAGES.PAS

 
Output of file : 4PAGES.PAS contained in archive : HP4PAGE.ZIP
program pages4;
type pagetype=^ttype;
ttype=array[1..54] of string [80];


var filename:string;
infile,outfile:text;
page1,page2,page3,page4:pagetype;
setnum :integer;
resetprn:string[10];

procedure getfilename (var filename:string);
begin
Writeln ('4-Page (C) 1990, Carl Jacobs');
writeln;
Write('Enter Filename to Print: ');
readln (filename);
end;

procedure getpage (var page:pagetype;var infile:text);
var index:integer;
begin
for index :=1 to 54 do
begin
if not (eof(infile)) then readln (infile,page^[index]);
if (page^[index][1]=#12) then begin
page^[index][0]:=#0;
index :=54;
end;
end;
end;

procedure printpage (page1,page2,page3,page4:pagetype;var outfile:text;setnum:integer);
var pitch,pitch5,size,center,crlf,ff,cntw,norm:string[10];
index:integer;
begin
pitch := chr(27)+'(s20H';
pitch5:= chr(27)+'(s5H';
size := chr(27)+'(s6V';
center:= chr(27)+'&a81C';
crlf := chr(27)+'='+chr(27)+'&a0C';
ff := chr(27)+'&l0H';
cntw := chr(27)+'&a20C';
norm := chr(27)+'&d@';

write(outfile,pitch,size,crlf);
write(outfile,pitch5,'Page ',(setnum-1)*4+1,cntw,
'Page ',(setnum-1)*4+2,pitch);
write(outfile,crlf);
for index := 1 to 54 do
write(outfile,page1^[index],center,page2^[index],crlf);
write(outfile,crlf);
write(outfile,crlf);
write(outfile,crlf);
write(outfile,crlf);
write(outfile,pitch5,'Page ',(setnum-1)*4+3,cntw,
'Page ',(setnum-1)*4+4,pitch,crlf);
for index := 1 to 54 do
write(outfile,page3^[index],center,page4^[index],crlf);
write (outfile,ff);
end;

procedure initpage(var page:pagetype);
var index:integer;

begin
for index := 1 to 54 do
page^[index][0]:=#0;
end;


begin
resetprn := chr(27)+'(s10h12V';
setnum :=0;
getfilename (filename);
assign (infile,filename);
reset (infile);
assign (outfile,'PRN');
rewrite (outfile);
while not eof(infile) do
begin
new(page1);
new(page2);
new(page3);
new(page4);
initpage(page1);
initpage(page2);
initpage(page3);
initpage(page4);
getpage(page1,infile);
getpage(page2,infile);
getpage(page3,infile);
getpage(page4,infile);
setnum := setnum +1;
printpage(page1,page2,page3,page4,outfile,setnum);
end;
write(outfile,resetprn);
close(infile);
close(outfile);
end.


  3 Responses to “Category : Printer Utilities
Archive   : HP4PAGE.ZIP
Filename : 4PAGES.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/