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-07-09 04:42:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!newspeer.clara.net!news.clara.net!server3.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Only one compilation unit. Date: Mon, 09 Jul 2001 10:53:37 +0100 Organization: University of Brighton Message-ID: <3B497F21.8CD784D8@brighton.ac.uk> References: NNTP-Posting-Host: pc2je.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 994678575 2826 193.62.183.154 (9 Jul 2001 11:36:15 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 9 Jul 2001 11:36:15 GMT X-Mailer: Mozilla 4.7 [en-gb] (Win95; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:9665 Date: 2001-07-09T11:36:15+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? For GNAT, yes. Simple solution: if you have x.adb containing procedure Main and procedure Sub, run "gnatchop x.adb" which will split the procedures into separate files called main.adb and sub.adb, then run "gnatmake main.adb" which will compile Main and any other units that it depends on (in this case, Sub). Note that Main will need to say "with Sub;" at the top... > Or is > it necessary to write .ads which describe each and every procedure? No. ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.comp.it.bton.ac.uk/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------