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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!2001:888:0:311::2f.MISMATCH!nzpost2.xs4all.net!news.kpn.nl!not-for-mail Subject: Re: Anonymous array not allowed as components To: AdaMagica Newsgroups: comp.lang.ada References: <5dbbeda6$0$1458$e4fe514c@news.kpn.nl> <6550e9fc-5c52-4f48-9b3d-bb543f88c1d9@googlegroups.com> From: L Dries Message-ID: Date: Fri, 1 Nov 2019 11:33:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <6550e9fc-5c52-4f48-9b3d-bb543f88c1d9@googlegroups.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: nl Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 97dbad92.news.kpn.nl X-Trace: G=ANiePiJO,C=U2FsdGVkX1/TE3SdYs0VNs+cf9uhkPB2Uobb9mxI4LC+tBRvZfAxtFXyDp9N8nDKcJPZ0VOgTDoYKmu00HGN0Xr8Dg1DY+gcqhfLdYusK0U= X-Complaints-To: abuse@kpn.nl Xref: reader01.eternal-september.org comp.lang.ada:57415 Date: 2019-11-01T11:33:54+01:00 List-Id: Op 1-11-2019 om 10:34 schreef AdaMagica: > Am Freitag, 1. November 2019 09:32:42 UTC+1 schrieb L Dries: >> I have an need for an array of Unbounded_Strings in which i define the >> elements. >> >> I declared it as: >> > type Container is record > ... >> Debug_Proc : array (1 .. nr_Proc) of Unbounded_String := >> (Debug_Proc(Lan), >> To_Unbounded_String("Only"), >> To_Unbounded_String("Empty_Buffer"), >> ... >> etc. > end record; >> >> Then I got the message: >> >> 65:22 Anonymous array not allowed as components >> This results i a position just before "array" > > Reading the compiler message, I get the impression that your Debug_Prog is a component of another record. Just define a matching type and use an object of this type as component. > I just found the following solution type Combo_Entry is array (1 .. nr_Proc) of Unbounded_String; Debug_Proc : Combo_Entry := (Debug_NoProc(Lan), To_Unbounded_String("Only"), To_Unbounded_String("Empty_Buffer"), ... This does not give the error anymore -- L. Dries