From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8f1d55ea4f471c1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-16 23:19:12 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!cs.utexas.edu!swrinde!gatech!usenet.ufl.edu!draco.nova.edu!alpha!mentat From: mentat@alpha.acast.nova.edu (MenTaT - !Productions) Subject: Re: Print Message-ID: Sender: news@draco.nova.edu (Usenet Administrator) Organization: Nova Southeastern University References: <3k8g1e$8ri@goanna.cs.rmit.edu.au> Date: Fri, 17 Mar 1995 06:06:05 GMT Date: 1995-03-17T06:06:05+00:00 List-Id: s9406160@yallara.cs.rmit.edu.au (Scott Malcolm Smedley) writes: >How can I "print" an array of integers/characters/strings etc >in ADA?? I mean "print" as in Printer. >For example, let's say I had an array(1..10) of integers. >How could I print each integer one underneath the other on >a printer? >I'm not 2 sure whether it matters or not, but I am using ADA on >a DOS machine, not UNIX. Open the printer as a sequential file... (There's probably a better way of doing it, but this works.) with SEQUENTIAL_IO; procedure FOO is package LPT_FLOAT_IO is new SEQUENTIAL_IO(FLOAT); -- You need one of these use LPT_FLOAT_IO; -- for each type you use. PRINTER: FILE_TYPE; STUFF: array(1 .. 10) of FLOAT; PRINTER_DEVICE: STRING(1 .. 20); begin -- FOO PRINTER_DEVICE:="lpt1"; -- DOS uses LPTx, UNIX uses /dev/lptx. OPEN(PRINTER, OUT_FILE, PRINTER_DEVICE); -- Fill your array. WRITE(PRINTER, STUFF(1)); end FOO; -- GCS -d+ H+ s++:- g+ p? !au a- w+++ !Productions 1995 v* C+++ UB+++A++++ P++ L++ E+ N+++ Note new email address! K+ !W--- M-- V po- Y+ t++ 5+ jx G? R tv++ D- B--- e+ u** h f r++ !n y+ "No matter where you go, there you are."