comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: array
Date: Thu, 12 Apr 2001 21:05:10 GMT
Date: 2001-04-12T21:05:10+00:00	[thread overview]
Message-ID: <3AD618BA.82F2A5D6@acm.org> (raw)
In-Reply-To: 5s2B6.32267$ii5.3236241@afrodite.telenet-ops.be

Pieter Thysebaert wrote:
> 
> Now I was looking for a function that would allow me to convert the contents
> of a tree into an array (and vice versa)
> I've found something like arrays with variable range (I mean not fixed at
> compile-time)
> Well I think that's what I found - does that thing exist ?

Certainly, if you have a function

function Size (Tree : Tree_Type_Name) return Natural;

that returns the number of elements in Tree, you can declare something
like

type Tree_As_Array is array (Positive range <>) of
Tree_Element_Type_Name;

and then declare an array of the right size for a specific tree

Flat : Tree_As_Array (1 .. Size (Tree) );

and then somehow extract the elements of Tree into the components of
Flat.

I'm not sure if this answers your question or not.

-- 
Jeff Carter
"English bed-wetting types."
Monty Python & the Holy Grail



  parent reply	other threads:[~2001-04-12 21:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-11 19:41 array Pieter Thysebaert
2001-04-12 14:59 ` array Ted Dennison
2001-04-12 18:59   ` array Des Walker
2001-04-12 18:51 ` array Stephen Leake
2001-04-12 21:05 ` Jeffrey Carter [this message]
2001-04-13  7:09 ` array Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
1998-04-15  0:00 Array BanaN
1998-04-17  0:00 ` Array BanaN
replies disabled

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