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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f2513845b4ef39f X-Google-Attributes: gid103376,public From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Subject: Re: More C Date: 2000/01/28 Message-ID: <86skkc$9281@news.cis.okstate.edu>#1/1 X-Deja-AN: 578848030 References: <3B9k4.122$Ro5.7388@nnrp3-w.snfc21.pbi.net> <86rbgm$9ic1@news.cis.okstate.edu> <86rkj7$6re$1@clnews.edf.fr> Organization: Oklahoma State University User-Agent: slrn/0.9.6.2 (Linux) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 2000-01-28T00:00:00+00:00 List-Id: On Fri, 28 Jan 2000 09:36:15 +0100, Pascal Obry wrote: >David, > >The answer to your question was in the message you quoted! > >To know the number of colors use : Palette.Colors'Length (.all is >not required here I think). > >You can also iterate through the table using: > > for K in Palette.Colors'Range loop > ... > end loop; > >Did I missed something ? We have a similar structure struct bob { char num_chars_in_b; char *b; /* array */ }; In memory (assuming 8 bit pointers) we have num_chars_in_b | pointer array | | | 03 20 ...... 01 10 10 23 58 20 48 . . . The only place in that memory where it tells you the length of the array is num_chars_in_b. No matter how you translate that structure into Ada, Ada can't give you the length of the array independent of num_chars_in_b, because it doesn't have the information. Or so I understand it. -- David Starner - dstarner98@aasaa.ofe.org If you wish to strive for peace of soul then believe; if you wish to be a devotee of truth, then inquire. -- Friedrich Nietzsche