From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Re: Why can't i get an EXE!
Date: Mon, 7 Jan 2002 11:06:15 +0000 (UTC)
Date: 2002-01-07T11:06:15+00:00 [thread overview]
Message-ID: <slrna3j09l.tt.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: z4MZ7.61963$4x4.8851706@news2-win.server.ntlworld.com
On Sat, 5 Jan 2002 23:33:58 -0000, NTL wrote:
> Package: QUE PACKAGE
>
> Hi
> I am a university student studying computer science's and have to create a
> small program as part of my coursework
> The program below compiles perfectly and builds in ADAGIDE GNAT3.11,
> however, I can not get it to create the .C and .EXE files... am I making
> some small fundemental mistake.
>
> any help gladly recievied.
>
> David.
>
> P.s. Complete newbie to ADA programming.
>
>
>
>>> BEGIN QUE.ADS
>
> package que is
> empty_queue : EXCEPTION;
>
> type queue is array(1..500) of integer;
>
> q : queue;
> tail : integer := 0;
> head : integer := 1;
> count : integer := 0;
Remove the 4 lines above. You don't need them.
> qs : queue;
> tails : integer := 0;
> heads : integer := 1;
> n : integer;
Move line above to add procedure.
> A : integer;
Move line above to main procedure.
> procedure initialiser(q: in out queue; head: in out integer; tail: in out
> integer);
> procedure add(q: in out queue; head: in out integer; tail: in out integer);
> procedure remove(q: in out queue; head: in out integer; tail: in out
> integer);
> procedure show(q: in out queue; head: in out integer; tail: in out integer);
replace "in out" with "in" in the 1 line above.
> procedure remove(q: in out queue; head: in out integer; tail: in out
> integer) is
> begin
> if head < tail then
This must be wrong?
> --put_line("Queue is currently empty");
> raise EMPTY_QUEUE;
> else
> head := head + 1;
Why do you do this?
> procedure show(q: in out queue; head: in out integer; tail: in out integer)
> is
> begin
> if head < tail then
This must be wrong?
>
> begin
> loop
> initialiser(q => qs, head => heads, tail => tails);
When you put the initialiser inside the loop it will be called each time
and thus reset your queue. Move it outside the loop.
Preben
--
() Join the worldwide campaign to protect fundamental human rights.
'||}
{||' http://www.amnesty.org/
next prev parent reply other threads:[~2002-01-07 11:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-05 23:33 Why can't i get an EXE! NTL
2002-01-06 0:52 ` Preben Randhol
2002-01-06 2:02 ` Phoenix.
2002-01-06 12:19 ` Preben Randhol
2002-01-07 11:06 ` Preben Randhol [this message]
2002-01-07 21:52 ` Liddle Feesh
2002-01-08 13:14 ` Phoenix.
2002-01-08 13:31 ` Phoenix.
2002-01-08 13:55 ` Liddle Feesh
2002-01-08 13:52 ` Liddle Feesh
2002-01-07 21:59 ` Liddle Feesh
-- strict thread matches above, loose matches on Subject: below --
2002-01-06 19:45 Phoenix.
2002-01-06 20:12 ` Preben Randhol
2002-01-06 22:03 ` Phoenix.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox