comp.lang.ada
 help / color / mirror / Atom feed
From: John Smith <yoursurrogategod@gmail.com>
Subject: Re: Multiple procedures in the same adb file?
Date: Sun, 11 Jan 2015 11:05:37 -0800 (PST)
Date: 2015-01-11T11:05:37-08:00	[thread overview]
Message-ID: <ddd07587-a6e8-4518-91f3-915341c7f6fb@googlegroups.com> (raw)
In-Reply-To: <5fc3a42d-f922-4e34-ab30-59613b980fb6@googlegroups.com>

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?

  reply	other threads:[~2015-01-11 19:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-11 18:37 Multiple procedures in the same adb file? John Smith
2015-01-11 19:05 ` John Smith [this message]
2015-01-11 19:51 ` Robert A Duff
2015-01-11 20:38   ` John Smith
2015-01-11 21:02     ` Robert A Duff
2015-01-11 21:51       ` John Smith
2015-01-12  0:53         ` Robert A Duff
2015-01-12  0:55         ` Robert A Duff
2015-01-13  0:11       ` Randy Brukardt
2015-01-11 21:38   ` Niklas Holsti
2015-01-12  0:53     ` Robert A Duff
2015-01-12  9:01       ` J-P. Rosen
2015-01-12 14:57         ` Robert A Duff
2015-01-13  0:09           ` Randy Brukardt
2015-01-12  0:55     ` Robert A Duff
2015-01-11 20:04 ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox