comp.lang.ada
 help / color / mirror / Atom feed
* Printing
@ 2002-04-15 16:12 Fraz
  2002-04-16 13:31 ` Printing Ted Dennison
  2002-04-23 15:47 ` Printing Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Fraz @ 2002-04-15 16:12 UTC (permalink / raw)


Hi all,

Sorry if this in an FAQ, but is there a command in ada that will send the
current window to the printer? or even the contents of an array?

At a push a basic command to print a file would do?

The simpler the better :) I just need to a print option

Cheers!!

Fraz





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

* Re: Printing
  2002-04-15 16:12 Printing Fraz
@ 2002-04-16 13:31 ` Ted Dennison
  2002-04-23 15:47 ` Printing Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Ted Dennison @ 2002-04-16 13:31 UTC (permalink / raw)


"Fraz" <fraz@totalise.co.uk> wrote in message news:<x_Cu8.20049$sL6.3522988@news11-gui.server.ntli.net>...
> Sorry if this in an FAQ, but is there a command in ada that will send the
> current window to the printer? or even the contents of an array?

Nope. Ada is not an Operating System, so it has no clue what devices
you have attached to your system and how to get hold of them.

However, most OS's allow you to open a printer device as a file. If
you can do that, then you can use any of Ada's file facilities to send
data to a printer. That will probably only work well for strings
though. If you want to send graphics, you will need to find out how
one does that with your OS, then call that OS routine(s) from Ada. The
latter is really the easy part. What you need to do from here is
reformulate the question as an operating system question, then go ask
it in the appropriate newsgroup for your OS.


-- 
T.E.D.
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



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

* Re: Printing
  2002-04-15 16:12 Printing Fraz
  2002-04-16 13:31 ` Printing Ted Dennison
@ 2002-04-23 15:47 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2002-04-23 15:47 UTC (permalink / raw)


"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



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

end of thread, other threads:[~2002-04-23 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-15 16:12 Printing Fraz
2002-04-16 13:31 ` Printing Ted Dennison
2002-04-23 15:47 ` Printing Stephen Leake

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