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=APOSTROPHE_FROM,BAYES_00, FROM_ADDR_WS,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c8533728e8d73d0 X-Google-Attributes: gid103376,public From: smoneill Subject: Re: Please help a beginner! (second try) Date: 1996/02/17 Message-ID: <4g5fr3$74d@news.sanders.lockheed.com>#1/1 X-Deja-AN: 139869432 references: <4g517q$438@helios.herts.ac.uk> content-type: text/plain; charset=us-ascii organization: SANDERS A Lockheed Martin Company mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 1.1N (Windows; I; 16bit) Date: 1996-02-17T00:00:00+00:00 List-Id: kst1ju@herts.ac.uk (Ryan) wrote: >Could somebody please help me with what I am sure is a simple >problem. I need to do some basic text and integer IO. The problem is simple. While you probably have all of the following in a single file it is actually 3 compilation units (the instantiation of Integer_IO, proc1 and main). To gain visibility to the services provided by Text_IO each of these units must import (with) the Text_IO package. IOW, proc1 and main must each 'with' Text_IO and Int_IO. >with TEXT_IO; >package INT_IO is new TEXT_IO.INTEGER_IO(INTEGER); --end of compilation unit INT_IO with Text_IO; >with INT_IO; >procedure proc1 is >begin > TEXT_IO.PUT("Hello"); > INT_IO.PUT(2); >end proc1; -- end of compilation unit proc1 with Text_IO; with Int_IO; >procedure main is >begin > TEXT_IO.PUT("Hello"); > INT_IO.PUT(2); >end main; This will noew work fine. BTW, DEC Ada supplies a version of Integer_IO pre-instantiated for you. It's called Integer_Text_IO. Nothing special about it, it just saves you from instantiating Integer_IO. Just remove the instantiation of INT_IO and change the references to Integer_Text_IO. > Thanks, Glad to be of help. -- Steve O'Neill | "No,no,no, don't tug on that! Sanders, A Lockheed Martin Company | You never know what it might smoneill@sanders.lockheed.com | be attached to." (603) 885-8774 fax: (603) 885-4071| Buckaroo Banzai