comp.lang.ada
 help / color / mirror / Atom feed
From: see@messagebody.com (Jan)
Subject: unconstrained records
Date: Sun, 22 Dec 2002 12:24:18 GMT
Date: 2002-12-22T12:24:18+00:00	[thread overview]
Message-ID: <3e05aebf.3122500@news.freenet.de> (raw)

Hi,

I have found an interesting source code in the book "Ada in action",
but the book could be better, because there is no background
information. Here is the problem:

procedure UnConstrained_Record is

   type Test (length : natural := 0) is
     record
        text : string (1..length);
     end record;

name : Test;

begin

   name := (5, "Bimbo");

   -- now I can resize the array inside the record

   name := (14, "This is a test");

   -- but now it comes

   name := (3, "abc");

   -- What happens to the memory? Are the 11 bytes freed           
   -- automatically?

end UnConstrained_Record;


Thanks!



             reply	other threads:[~2002-12-22 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-22 12:24 Jan [this message]
2002-12-22 13:52 ` unconstrained records SteveD
2002-12-22 18:54   ` Jan
2002-12-22 19:14     ` Robert A Duff
2002-12-27 20:34       ` Randy Brukardt
2002-12-23  4:30     ` SteveD
replies disabled

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