From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,959bd5b133447bcd X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Help with project Date: 1999/04/19 Message-ID: #1/1 X-Deja-AN: 468426500 References: <371c09bd.16531847@news.ptd.net> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1999-04-19T00:00:00+00:00 List-Id: 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