Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpda!hpcuhb!hpcllla!hpclisp!defaria@hpclapd.HP.COM From: defaria@hpclapd.HP.COM (Andy DeFaria) Newsgroups: comp.lang.ada Subject: Re: Help! Message-ID: <920033@hpclapd.HP.COM> Date: 26 Sep 90 16:27:50 GMT References: <9009241422.AA17160@wrdis01.af.mil> Organization: Hewlett-Packard Calif. Language Lab Lines: 24 >/ hpclapd:comp.lang.ada / kmccook@WRDIS01.AF.MIL (Ken McCook;SCDQ;) / 6:52 am Sep 23, 1990 / >I'd prefer to write directly to the printer, but I could live >with having to write to a file and then printing the file. >I had hoped that Ada's Text_IO would have the capabilities >Turbo Pascal has for directing output directly to the printer >using Write and WriteLn? (And I'd hoped for direct keyboard >reading as well like someone else on the net in recent days. >Something like Turbo's "Read (kbd, X);".) The simple, quick and dirty answer is to write your routines in Turbo Pascal and pragma INTERFACE to them. Write a general purpose TP routine to Write_to_Printer and a Read_From_Keyboard then encapsulate the interface into an Ada package pragma INTERFACEing to your TP routines. But you may want to check out the Ada way of writing to a file and have that file point to a printer. I haven't done this but I'm sure it's possible. WRT reading from the keyboard, if you want anykind of real control over what is read then you might want to interface to TP or TC or whatever. If you are simply reading in stuff then you could use TEXT_IO.GET or TEXT_IO.GET_LINE.