comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Enormous problems in one of my programs!
Date: 24 May 2002 13:14:52 -0400
Date: 2002-05-24T17:21:45+00:00	[thread overview]
Message-ID: <ud6vlmprn.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: a4e39c77.0205240213.16d0d042@posting.google.com

b99andla@student.his.se (Kladde) writes:

> Helllo! I have a home assignment in ADA, and sice Im not used to this
> language I need some help, I would be very greatful. Below I will
> insert a start, header and body file and any faults or problems you
> can find I will be very happy for. Under the code I will insert the
> compile failures I get when trying to compile.
> 
> All help is greatly appreciated!!

The biggest problem is the syntax for a protected body. Also, you have
"Island_T" in the spec, but "Island" in the body. Fix those problems,
and you'll get more helpful errors from the compiler.

Here is the correct syntax for the body of Island_T:

   protected body Island_T is

      entry Get_Random_Female(hona: out Server_P) when True is
      begin
         hona := honor(par);
         return;
      end Get_Random_Female;


      procedure Breed is
      begin
         if(par <= 100) then
            hanar(par) := new Male;
            honor(par) := new Female;
            par := par+1;
         end if;
      end Breed;

   end Island_T;

The compiler still reports errors here, but you should be able to
figure them out.


-- 
-- Stephe



  parent reply	other threads:[~2002-05-24 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24 10:13 Enormous problems in one of my programs! Kladde
2002-05-24 13:35 ` Ted Dennison
2002-05-24 13:57   ` Andreas Lans
2002-05-24 14:55 ` Preben Randhol
2002-05-24 15:26   ` Andreas Lans
2002-05-24 17:14 ` Stephen Leake [this message]
2002-05-25  1:26   ` Liao Choon Way
2002-05-25 15:31     ` Adrian Hoe
replies disabled

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