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,f02b102d63b5d10 X-Google-Attributes: gid103376,public From: dale@cs.rmit.edu.au (Dale Stanbrough) Subject: Re: I have a question about the "record" in ADA Date: 1999/05/22 Message-ID: #1/1 X-Deja-AN: 480695175 References: <7i453r$l5m$1@wanadoo.fr> X-Complaints-To: abuse@cs.rmit.edu.au X-Trace: emu.cs.rmit.edu.au 927326126 24196 131.170.66.220 (21 May 1999 22:35:26 GMT) Organization: RMIT NNTP-Posting-Date: 21 May 1999 22:35:26 GMT Newsgroups: comp.lang.ada Date: 1999-05-21T22:35:26+00:00 List-Id: In article <7i453r$l5m$1@wanadoo.fr>, "mike" wrote: > Sorry for my bad English :) > How could I do to access to the different part of a record which is > a generic parameter in a generic package? > because my function in my package must acces in the record. > Mike If you want to access particular fields, then you don't _really_ want to pass in any record (i.e. you don't want it as a generic parameter), you are wanting to pass in a -particular- record. Otherwise how in the world would you know what fields are in there? Solutions are... You can modify the parameters to the subprograms in the generic to include the record type you want to access. You can pass in a _particular_ tagged type record as a generic parameter. generic type Element is new Root_Type with private; (i think!) You could pass in accessor functions that will extract the information you want out of the generic parameter. e.g. generic type element is private; with function Get_Field1 (Item : Element) return X; with function Get_Field2 (Item : Element) return Y; etc. Dale