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-15 03:41:03 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.media.kyoto-u.ac.jp!sjc-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Only one compilation unit. Message-ID: <1luFIcjdO+HI@eisner.encompasserve.org> References: <3B497F21.8CD784D8@brighton.ac.uk> Organization: LJK Software Date: 15 Jul 2001 06:40:59 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 995193662 216.44.122.34 (Sun, 15 Jul 2001 10:41:02 GMT) NNTP-Posting-Date: Sun, 15 Jul 2001 10:41:02 GMT Xref: archiver1.google.com comp.lang.ada:9970 Date: 2001-07-15T06:40:59-05:00 List-Id: In article , Simon Wright writes: > John English writes: > >> 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... > > It's probably a good idea to name the file containing your source > using a file extension other than .adb or .ads (or .adp or .adc, in > case you take up extended features later). I'd use .ada What does .adc mean (outside the context of Compaq (nee DEC (nee VAX)) Ada ? > We had fun when the source was called Foo.ads, under NT one of the > split files ended up also called Foo.ads -- which overwrote our > original. Also, GNAT does *not* like files with upper-case letters in > the name at all! Even on VMS ?