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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9b84a0d726430783 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-29 07:54:09 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!news.duke.edu!zombie.ncsc.mil!paladin.american.edu!auvm!J64.STRATCOM.AF.MIL!BennettC Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Encoding: 46 TEXT X-Mailer: Microsoft Mail V3.0 Message-ID: <2EDB699A@SMTPGATE2.STRATCOM.AF.MIL> Date: Tue, 29 Nov 1994 09:52:00 PST Sender: Ada programming language From: "Bennett, Chip (KTR) ~U" Subject: Re: Help with gnat IO Date: 1994-11-29T09:52:00-08:00 List-Id: Woodrow Yeung wrote: > I'm using gnat and am having trouble with the input/output routines. > First of all, how do I use the INTEGER_IO package? I get this error > message: > file "integer_io.ads" not found > but I see the INTEGER_IO package defined within the a-textio.ads file. > I want to be able to format my field width. Remember that INTEGER_IO is a generic package within TEXT_IO. You "with" in TEXT_IO and then instantiate your own version of INTEGER_IO: with Text_IO; use Text_IO; procedure WhoCares is type ItemCount is range 0 .. 100; package ItemCount_IO is new Integer_IO (ItemCount); use ItemCount_IO; MyCount : ItemCount := 10; package Int_IO is new Integer_IO (Integer); use Int_IO; Count : Integer := 348; begin Put (MyCount); -- implicitly uses ItemCount_IO.Put; Put (Count); -- implicitly uses Int_IO.Put; end WhoCares; INTEGER_IO is a generic package _because_ there can be many user defined integer types. If you already knew all this, it was good practice for me to tell it anyway. :-) ***************************************************************** * Chip Bennett, GDE Systems Inc | BennettC@j64.stratcom.af.mil * * USSTRATCOM/J64213 | Voice (402)294-7360 * * 901 SAC Blvd, Suite 2B24 | FAX (402)294-7912 * * Offutt AFB, NE 68113-6600 | Proud member of Team Ada * * Opinions expressed here are my own _so_, TTFWTW * *****************************************************************