comp.lang.ada
 help / color / mirror / Atom feed
* Re: Output to printer
  1999-07-03  0:00 Output to printer Peter Cathcart
@ 1999-07-03  0:00 ` David C. Hoos, Sr.
  1999-07-04  0:00   ` Peter Cathcart
  0 siblings, 1 reply; 3+ messages in thread
From: David C. Hoos, Sr. @ 1999-07-03  0:00 UTC (permalink / raw)


Peter Cathcart <pete@petros-world.freeserve.co.uk> wrote in message
news:7ll4j7$p88$1@news8.svr.pol.co.uk...
> Hi,
>
> I was wondering, is there a simple way to direct output to a printer. I'm
> using ObjectAda 7.1 (SE) on Windows '98 to write a console application and
> I'd like to be able to send output to a prnter connected to port LPT1.
>
I don't have Win98 installed on any of my machines, but this works
with GNAT and Windows NT:

with Ada.Text_IO;
procedure Printer is
   The_File : Ada.Text_IO.File_Type;
begin
   Ada.Text_IO.Create
     (File => The_File,
      Name => "LPT1",
      Mode => Ada.Text_IO.Out_File);
   Ada.Text_IO.Put_Line
     (File => The_File,
      Item => "The quick brown fox jumps over the lazy dog's back.");
   Ada.Text_IO.Put_Line
     (File => The_File,
      Item => "30");
   -- Eject the page
   Ada.Text_IO.Set_Line
     (File => The_File,
      To => 1);
end Printer;






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Output to printer
@ 1999-07-03  0:00 Peter Cathcart
  1999-07-03  0:00 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Cathcart @ 1999-07-03  0:00 UTC (permalink / raw)


Hi,

I was wondering, is there a simple way to direct output to a printer. I'm
using ObjectAda 7.1 (SE) on Windows '98 to write a console application and
I'd like to be able to send output to a prnter connected to port LPT1.

Is there a file handle like 'Standard_Output' that prints to this port
instead of the screen? Or is it much more difficult than this.

Any help would be greatly appreciated.


Pete






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Output to printer
  1999-07-03  0:00 ` David C. Hoos, Sr.
@ 1999-07-04  0:00   ` Peter Cathcart
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Cathcart @ 1999-07-04  0:00 UTC (permalink / raw)



David C. Hoos, Sr. wrote in message <8Y4#7tVx#GA.184@newstoo.hiwaay.net>...
>Peter Cathcart <pete@petros-world.freeserve.co.uk> wrote in message
>news:7ll4j7$p88$1@news8.svr.pol.co.uk...
>> I was wondering, is there a simple way to direct output to a printer. I'm
>> using ObjectAda 7.1 (SE) on Windows '98 to write a console application
and
>> I'd like to be able to send output to a prnter connected to port LPT1.
>>
>I don't have Win98 installed on any of my machines, but this works
>with GNAT and Windows NT:
>
[snipped code]

Thanks, that worked a treat.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-07-04  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-03  0:00 Output to printer Peter Cathcart
1999-07-03  0:00 ` David C. Hoos, Sr.
1999-07-04  0:00   ` Peter Cathcart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox