comp.lang.ada
 help / color / mirror / Atom feed
* can a record contain an array whose bounds are not known at   co  mpi le time?
@ 2002-10-25 14:40 Caldwell Ian
  2002-10-25 14:55 ` John McCabe
  0 siblings, 1 reply; 2+ messages in thread
From: Caldwell Ian @ 2002-10-25 14:40 UTC (permalink / raw)


Use a discriminated type. See RM section 3.7;

An examples of discriminated type:

type Buffer(Size : Buffer_Size := 100)  is       
   record
      Value : String(1 .. Size);
   end record;

Ian Caldwell
Q218 
QinetiQ Malvern 
+ 44 (0) 1684 89 4461

-----Original Message-----
From: Yu, Liyang [mailto:Liyang.Yu@delta.com]


Hi,

I need to use an array in a record and this array's bound is not known at
compile time. Can Ada do this? Can someone give me a example about how to do
this or any reference that I can use?

Thanks!

The Information contained in this E-Mail and any subsequent correspondence
is private and is intended solely for the intended recipient(s).
For those other than the recipient any disclosure, copying, distribution,
or any action taken or omitted to be taken in reliance on such information
is prohibited and may be unlawful.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: can a record contain an array whose bounds are not known at co  mpi le time?
  2002-10-25 14:40 can a record contain an array whose bounds are not known at co mpi le time? Caldwell Ian
@ 2002-10-25 14:55 ` John McCabe
  0 siblings, 0 replies; 2+ messages in thread
From: John McCabe @ 2002-10-25 14:55 UTC (permalink / raw)


On Fri, 25 Oct 2002 15:40:08 +0100, Caldwell Ian
<ICCALDWELL@qinetiq.com> wrote:

Also read about mutable and immutable types - these depend on whether
you have a default discriminant I think.

>Use a discriminated type. See RM section 3.7;
>
>An examples of discriminated type:
>
>type Buffer(Size : Buffer_Size := 100)  is       
>   record
>      Value : String(1 .. Size);
>   end record;
>
>Ian Caldwell
>Q218 
>QinetiQ Malvern 
>+ 44 (0) 1684 89 4461
>
>-----Original Message-----
>From: Yu, Liyang [mailto:Liyang.Yu@delta.com]
>
>
>Hi,
>
>I need to use an array in a record and this array's bound is not known at
>compile time. Can Ada do this? Can someone give me a example about how to do
>this or any reference that I can use?
>
>Thanks!
>
>The Information contained in this E-Mail and any subsequent correspondence
>is private and is intended solely for the intended recipient(s).
>For those other than the recipient any disclosure, copying, distribution,
>or any action taken or omitted to be taken in reliance on such information
>is prohibited and may be unlawful.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-25 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-25 14:40 can a record contain an array whose bounds are not known at co mpi le time? Caldwell Ian
2002-10-25 14:55 ` John McCabe

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