From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 12 Aug 93 16:26:45 GMT From: dst17!mab@ford-wdl1.arpa (Mark A Biggar) Subject: Re: Unconstrained arrays Message-ID: <1993Aug12.162645.8669@wdl.loral.com> List-Id: In article <9308111528.aa04642@Paris.ics.uci.edu> kanderso@mabillon.ICS.UCI.EDU (Kenneth Anderson) writes: > I have declared the following type (DynamicString is an imported type) > type Str_Array is array (Natural range <>) of DynamicString; >Later when I try to declare objects of this type, the compiler likes this > Viewers : str_array(1 .. 6) := (Create("Airspeed_Guage"), > Create("Altimeter_Guage"), > Create("Compass_Guage"), > Create("Horizon_Guage"), > Create("ROC_Guage"), > Create("Turn_Guage")); >but it does not like this > Viewers : str_array(1 .. 1) := (Create("text_artist")); >Here is the error message generated by the SunAda 1.1 compiler >--### A:error: RM 8.3: no visible identifier is of type str_array >If I change the above declaration to > Viewers : str_array(1 .. 2) := (Create("text_artist"), > Create("ignore")); >The compiler is happy again. I think that one of your problems is that the error message is very missleading. You real problem is that you can't use positional notation for single element aggregates. The compiler can't tell the difference between a single element positional aggregate and a simple expression with an extra set of enclosing parens. So convert your aggregate to named notation like so: Viewers : str_array(1..1) := (1 => Create("text_artist")); and that should fix your problem. And, if you really want to make sure that the complier excepts and also document what is really going on, use a qualified expression for the initializer like so: Viewers : str_array(1..1) := str_array'(1 => Create("text_artist")); -- Mark Biggar mab@wdl.loral.com