comp.lang.ada
 help / color / mirror / Atom feed
From: L Dries <bertus.dries@planet.nl>
To: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Anonymous array not allowed as components
Date: Fri, 1 Nov 2019 11:33:54 +0100
Date: 2019-11-01T11:33:54+01:00	[thread overview]
Message-ID: <b4d8ec1f-e87e-af64-027f-77781b40f648@planet.nl> (raw)
In-Reply-To: <6550e9fc-5c52-4f48-9b3d-bb543f88c1d9@googlegroups.com>

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

  parent reply	other threads:[~2019-11-01 10:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01  8:32 Anonymous array not allowed as components L Dries
2019-11-01  9:34 ` joakimds
2019-11-01 10:00   ` L Dries
2019-11-01 10:47   ` Jeffrey R. Carter
2019-11-01  9:34 ` AdaMagica
2019-11-01  9:56   ` L Dries
2019-11-01 10:33   ` L Dries [this message]
2019-11-01 15:55     ` AdaMagica
2019-11-01 10:41 ` Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox