comp.lang.ada
 help / color / mirror / Atom feed
From: Eric Jacoboni <jaco@neottia.net>
Subject: Re: Newbie problem: unconstrained subtype not allowed
Date: Wed, 20 Apr 2005 01:52:11 +0200
Date: 2005-04-20T01:52:11+02:00	[thread overview]
Message-ID: <m28y3el3ys.fsf@mac.scrogneugneu.org> (raw)
In-Reply-To: d18a5f0d.0504191448.2692a55e@posting.google.com

frankgerlach@gmail.com (Frank Gerlach) writes:

>    feldEA : Ada.Streams.Stream_Element_Array;
>
> How do I "initialize" this data type ?
>
> Thanks for helping an Ada newbie !

Type Stream_Element_Array is an unconstrained type:

type Stream_Element_Array is
      array (Stream_Element_Offset range <>) of aliased Stream_Element;

So, you have to constraint it to create a object of this type:

A_Stream_Element_Array : Stream_Element_Array(1..100);

for exemple (a better solution is to use a constrained subtype, but
you've got the idea).

-- 
�ric Jacoboni, n� il y a 1417398423 secondes



  reply	other threads:[~2005-04-19 23:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 22:48 Newbie problem: unconstrained subtype not allowed Frank Gerlach
2005-04-19 23:52 ` Eric Jacoboni [this message]
2005-04-19 23:55 ` Stephen Leake
replies disabled

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