comp.lang.ada
 help / color / mirror / Atom feed
From: John Smith <yoursurrogategod@gmail.com>
Subject: Multiple procedures in the same adb file?
Date: Sun, 11 Jan 2015 10:37:47 -0800 (PST)
Date: 2015-01-11T10:37:47-08:00	[thread overview]
Message-ID: <5fc3a42d-f922-4e34-ab30-59613b980fb6@googlegroups.com> (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?


             reply	other threads:[~2015-01-11 18:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-11 18:37 John Smith [this message]
2015-01-11 19:05 ` Multiple procedures in the same adb file? 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
replies disabled

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