<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Not really sure how you would adapt this to your setup, but I threw this together from a project I did previously. I've only tested it with the Windows 10 builtin XPS and PDF printers so I'm not sure how it will behave on a real printer.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(Hopefully the attachment makes it through..)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="Signature">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
--</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Alexander Grotewohl</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
https://dcclost.com</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> fpc-pascal <fpc-pascal-bounces@lists.freepascal.org> on behalf of Francisco Glover via fpc-pascal <fpc-pascal@lists.freepascal.org><br>
<b>Sent:</b> Wednesday, April 29, 2020 4:42 AM<br>
<b>To:</b> fpc-pascal@lists.freepascal.org <fpc-pascal@lists.freepascal.org><br>
<b>Cc:</b> Francisco Glover <francisco.glover@gmail.com><br>
<b>Subject:</b> [fpc-pascal] Porting from Turbo Pascal to FPC</font>
<div> </div>
</div>
<div>
<div dir="ltr">Overt the years I have developed programs in Turbo Pascal for student lab use, in which the student can easily send to an attached printer contents of the text or VGA graphics screens. These no longer work on Windows 10. In shifting to FPC
, certain key procedures which worked in Turbo Pascal running on Windows XP no longer work in FPC running on Windows 10. Samples are shown below:
<div>=======================================================</div>
<div>Program Sample;<br>
{$ mode TP}<br>
Uses Crt, Dos, Printer;<br>
Var Regs: Registers;<br>
<br>
Procedure Print_screen; { Interupt $05 }<br>
Begin<br>
Intr($05, Regs);<br>
End; {Nothing printed, exit code= 0}<br>
<br>
Procedure Print_string;<br>
Begin<br>
Writeln('Text Screen');<br>
Writeln(LST, 'String to be printed');<br>
End; {nothing printed, system hangs}<br>
<br>
<br>
Procedure Print_characters; {Intrupt $17, function 0, char to printer}<br>
Var j: byte;<br>
Msg: String[2];<br>
Begin<br>
Msg := 'A' + #11; { #11 = formfeed }<br>
For j := 1 to 2 do<br>
Begin<br>
Regs.AH := 0; {Function 0, output char}<br>
Regs.AL :=Ord(Msg[j]);<br>
Regs.DX := 0; {default printer}<br>
Intr($17, Regs);<br>
End;<br>
End; {Nothing printed, exit code= 0}<br>
<br>
Procedure Print1Char; {Interupt $21, Fcn 5}<br>
Begin<br>
Regs.AH := 5; {print character}<br>
Regs.DL := 'A';<br>
MSDos(Regs);<br>
Regs.AH := 5; {print character}<br>
Regs.DL := #11; {formfeed}<br>
MSDos(Regs);<br>
End; {Nothing printed, exit code= 0}</div>
<div>============================================================</div>
<div>How can I have my FPC programs running on Windows 10 send text and graphics screens direct to an attached printer? Thank you<br>
<br>
</div>
</div>
</div>
</body>
</html>