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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,29f311e5e4153888 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: "ramesh" Newsgroups: comp.lang.ada Subject: Re: need help with errors im getting Date: 2 Jul 2005 01:14:21 -0700 Organization: http://groups.google.com Message-ID: <1120292061.633464.143810@o13g2000cwo.googlegroups.com> References: <1119650372.546285.220190@z14g2000cwz.googlegroups.com> <1119724710.107186.139010@g47g2000cwa.googlegroups.com> <6g5sb1ptj1611oq6vbiirutlj9gv5lv39m@4ax.com> <1119773542.691728.137240@g49g2000cwa.googlegroups.com> NNTP-Posting-Host: 158.135.0.44 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1120292066 27137 127.0.0.1 (2 Jul 2005 08:14:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 2 Jul 2005 08:14:26 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=158.135.0.44; posting-account=jaODIw0AAAAqz8a5fLvIQzGSVAOK2M7x Xref: g2news1.google.com comp.lang.ada:11828 Date: 2005-07-02T01:14:21-07:00 List-Id: Hi I need some help again, I finished with my recent types, person,employee,student,citizen,faculty,staff. now i have to add a university, college and department to be associated to it. The University has following fields: name, Datefounded, collegeArray:array(1..4) of college_ptr; numcollege :integer; it has following methods University(un,df) printName() InsertCollege(collpt) printDateFOunded() PrintAll() ------ should list all information abt university including names of colleges. I have got all methods in it excecpt in PrintAll() i m not able to access colleges, i mean names of colleges associated with univ to print. i have got doubt abt Insert college also. procedure InsertCollege(u: in out Univ_ptr; c: in out College_ptr; un: Univ_Name1; df : Date; c1: College_Name) is--;c1: in out College_ptr) is begin for i in 1..4 loop u.Col_Array(i) := new College; c.Name := un; c.DateFounded := df; c.Col_Name:= c1; end loop end InsertCollege; ------comment on above code if its correct and make necessary changes. the doubt i have with it is when only one college details are passed to it why i need a loop if i remove it the prob is when a second college needs to be inserted in the array how to increment the value of i, should i have explictly mention Col_array(1) Col_array(2) .... when a new college is created. The main prob is with my PrintAll() in accesing the college names from college array The code i wrote is procedure PrintAll(u: Univ_ptr)is temp: college_Array; begin new_line; Put(" University Name : "); put (u.Name); new_line; put(" The University was founded on : "); put(u.DateFounded); new_line; put("******************************************"); new_line; put("The colleges in the university are: "); new_line; put(u.Col_Array(1).Col_name); --for i in 1..4 loop --put(Col_Array(i).Col_Name); --end loop; --for i in 1..u.Col_Array'Last loop --put(u.Col_Array(i.all)); --new_line; --end loop; end PrintAll; it compiles but gives a constraint error when trying to print college names I can send the entire code if needed.