comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Printing
Date: 23 Apr 2002 11:47:55 -0400
Date: 2002-04-23T15:54:06+00:00	[thread overview]
Message-ID: <uznzuo1qs.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: x_Cu8.20049$sL6.3522988@news11-gui.server.ntli.net

"Fraz" <fraz@totalise.co.uk> writes:

> Hi all,
> 
> Sorry if this in an FAQ, but is there a command in ada that will send the
> current window to the printer? 

"window" and "printer" are not things that the Ada language defines
(neither is "command", but I'll assume you meant "statement"). So no,
the Ada language has no way to "send the window to the printer".

However, there may be a library package for your windowing system and
operating system that do this. What windowing system and operating
system are you using?

> or even the contents of an array?

Ada does define arrays, so we're getting closer :). Ada.Text_IO is
used to generate text images of things, which can normally be sent to
a printer in a useful way. However, Ada.Text_IO does not support
arrays directly. I wrote a package that does array Text_IO; see
http://users.erols.com/leakstan/Stephe/Ada/sal.html, specifically the
package SAL.Gen_Array_Text_IO.

You'll still have to figure out how to map the file name to a printer
on your system.

On the other hand, you may find that dumping an array to a text file
is what you really want to do. You can read the file in any old
editor, and you only inconvenience some electrons, rather than killing
trees :).

> At a push a basic command to print a file would do?
> 
> The simpler the better :) I just need to a print option

For Windows, I have another package Windex
(http://users.erols.com/leakstan/Stephe/Ada/windex.html), which
provides the package Windex.Graphics_Devices.Printers. This provides a
simple interface to a printer on a Windows system. The test code
provided with Windex gives an example of how to use it.

Things should be as simple as possible, but no simpler!

-- 
-- Stephe



      parent reply	other threads:[~2002-04-23 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-15 16:12 Printing Fraz
2002-04-16 13:31 ` Printing Ted Dennison
2002-04-23 15:47 ` Stephen Leake [this message]
replies disabled

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