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,dbcd0557f06cdbfa X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-15 05:53:41 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B29F88D.FC9B73FC@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Only one compilation unit. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 15 Jun 2001 12:53:41 GMT NNTP-Posting-Host: 158.252.122.216 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 992609621 158.252.122.216 (Fri, 15 Jun 2001 05:53:41 PDT) NNTP-Posting-Date: Fri, 15 Jun 2001 05:53:41 PDT X-Received-Date: Fri, 15 Jun 2001 05:51:36 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:8775 Date: 2001-06-15T12:53:41+00:00 List-Id: McDoobie wrote: > > Alright, I'm writing a small program using two procedures. > > Now I'm coding both procedures within the same .adb file. When I go to > compile the program I get an error that says "end of file expected, can > only have one compilation unit." > > Now, that only happens when writing programs with more than one procedure. > > Do I have to put each different procedure in a seperate text file? Or is > it necessary to write .ads which describe each and every procedure? > Any help would be appreciated. > You already got the basic answer to your question in the other postings, but let me just add some info about a common Ada programming idiom. If you're writing what might be considered a single procedure, but you don't like doing lots of procedure nesting, you can create a package to contain the procedures. (This approach uses packages simply as an encapsulation mechanism.) At the one extreme the package could then provide just a single visible procedure, for example: procedure Run; which is then called by your main program. On the other hand, if the package makes visible a few key procedures, then your main program can implement the high-level logic, orchestrating the calls to this support package. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com