comp.lang.ada
 help / color / mirror / Atom feed
* Multiple procedures in the same adb file?
@ 2015-01-11 18:37 John Smith
  2015-01-11 19:05 ` John Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: John Smith @ 2015-01-11 18:37 UTC (permalink / raw)


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?


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-01-13  0:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-11 18:37 Multiple procedures in the same adb file? John Smith
2015-01-11 19:05 ` John Smith
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

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