comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Help with project
Date: 1999/04/19
Date: 1999-04-19T00:00:00+00:00	[thread overview]
Message-ID: <uvhes9ydi.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 371c09bd.16531847@news.ptd.net

rross@postoffice.ptd.net (bob) writes:

> I must declare a record for a customer in the generic spec , and
> instantiate it in our source code, inside this record will be info
> about
> the customer(time in queue, etc),
> now, below in the private area, I have
>  PRIVATE
>   TYPE line;
>   TYPE line_access IS ACCESS line; 
>   TYPE line IS RECORD 
>         info: X;
>         Next: line_access;      
>   END RECORD;
> 
> TYPE Agent IS RECORD
>       	Head:line_access;
>           cur_cust:line_access;
>           free_time:Integer;
> 	   etc(things for the agent)     
> END RECORD;
> 
> where X is the customer record which will instantiated
> the problem is, i have subprograms in the source that wont compile
> because
> i cant access agent or any of its fields, unless i go through the
> spec.

One suggestion is to simply not make anything private, until you've
got everything working. Then go back and see how you can arrange
things nicely into packages. Normally, this is not a good way to
design a system, but while you're still learning a language, it helps
to just write lots of working code.

> 
> if i put the subprograms to the body, then it cant find the fields for
> the
> customer
> do u have any ideas what to do?

You can add subprograms to the spec to provide access to the fields
you need:

procedure Set_free_time (Time : in Integer; Object : in out Agent);

-- Stephe




  reply	other threads:[~1999-04-19  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-18  0:00 Help with project bob
1999-04-19  0:00 ` Stephen Leake [this message]
1999-04-20  0:00   ` Ehud Lamm
replies disabled

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