comp.lang.ada
 help / color / mirror / Atom feed
From: "Andreas Lans" <b99andla@student.his.se>
Subject: Re: Array problem
Date: Sat, 25 May 2002 08:49:34 GMT
Date: 2002-05-25T08:49:34+00:00	[thread overview]
Message-ID: <yeIH8.39886$n4.8879213@newsc.telia.net> (raw)
In-Reply-To: slrnaetfpu.333.randhol+abuse@kiuk0156.chembio.ntnu.no



Well, I tried the thing you tipped me about, and I also tried just to put a
one in there just to see if it would work, but it still says Illegal operand
for array conversion, any thoughts on this?





"Preben Randhol" <randhol+abuse@pvv.org> skrev i meddelandet
news:slrnaetfpu.333.randhol+abuse@kiuk0156.chembio.ntnu.no...
> On Fri, 24 May 2002 22:09:41 GMT, Andreas Lans wrote:
> > Thanks for all your help so far, I got the program working at least, but
now
> > a runtime error has started to come up, and the thing its complaining
about
> > is this:
> >
> > if(pairs <= 100) then
> >
> > Clients(Pairs) := new Male;
> >
> > Servers(Pairs) := new Female;
> >
> > Pairs := Pairs+1;
> >
> >
> >
> > Where Pairs is an integer, I thought I could use this to store Females
and
> > Males in the array but when I try this, it says: Illegal operand for
array
> > conversion, any thoughts on this??
>
>
> if you look in the spec file (.ads) you see that the array is defined
> from 1 .. 100 and your Pairs start with 0. This means you are trying to
> access outside the bounds of the array. Either change the pairs
> initiation to 1 or do:
>
>
> Pairs := Pairs+1;
> if(pairs <= 100) then
>  Males (Pairs) := new Male;
>  Females (Pairs) := new Female;
> end if;
>
> Now the program won't crash, but it won't do much either.
>
> Preben





  reply	other threads:[~2002-05-25  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24 22:09 Array problem Andreas Lans
2002-05-24 22:31 ` Preben Randhol
2002-05-25  8:49   ` Andreas Lans [this message]
2002-05-25 12:12     ` Preben Randhol
2002-05-25 16:30     ` Robert Dewar
2002-05-25 18:00       ` Andreas Lans
2002-05-26  9:09         ` Preben Randhol
2002-05-25 16:38     ` Robert Dewar
2002-05-25 11:30   ` Robert Dewar
2002-05-27 10:39 ` Alfred Hilscher
replies disabled

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