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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.78.69 with SMTP id z5mr6757779obw.4.1421003138268; Sun, 11 Jan 2015 11:05:38 -0800 (PST) X-Received: by 10.140.28.180 with SMTP id 49mr568347qgz.4.1421003138007; Sun, 11 Jan 2015 11:05:38 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h15no3416799igd.0!news-out.google.com!qk8ni2672igc.0!nntp.google.com!f12no451126qad.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 11 Jan 2015 11:05:37 -0800 (PST) In-Reply-To: <5fc3a42d-f922-4e34-ab30-59613b980fb6@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=50.138.174.211; posting-account=AvekzAoAAABj-TclKcOWQmXwA49MFPGX NNTP-Posting-Host: 50.138.174.211 References: <5fc3a42d-f922-4e34-ab30-59613b980fb6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Multiple procedures in the same adb file? From: John Smith Injection-Date: Sun, 11 Jan 2015 19:05:38 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:24535 Date: 2015-01-11T11:05:37-08:00 List-Id: One more question. Can a file have multiple procedures (as well as a mix of procedures and functions) as well as functions in them as well? Or would I need to put them into a package? What does the error "end of file expected, file can have only one compilation unit" mean exactly? On Sunday, January 11, 2015 at 1:37:48 PM UTC-5, John Smith wrote: > Hello, > > I have a question, what if I want multiple procedures in the same adb file, can that be done? This is my code right now: > > =============================================================================== > procedure a_test(A, B : Integer; C : out Integer) is > begin > C := A + B; > end a_test; > > procedure test_procedure is > output : Integer; > begin > a_test(23, 34, output); > end test_procedure; > =============================================================================== > > And this is the compilation error that I got: > =============================================================================== > % gnatmake -g test_procedure.adb > gcc -c -g test_procedure.adb > test_procedure.adb:16:01: end of file expected, file can have only one compilation unit > gnatmake: "test_procedure.adb" compilation error > =============================================================================== > > Basically, if I have the program entrance function, how do I add others so as to break up the logic of the program?