comp.lang.ada
 help / color / mirror / Atom feed
From: arthurw@bigfoot.com.ignore.this.net (Arthur Ward)
Subject: Re: An array of records within an array of records (Still a problem)
Date: 1998/05/02
Date: 1998-05-02T00:00:00+00:00	[thread overview]
Message-ID: <354b2695.37415661@news.ua.edu> (raw)
In-Reply-To: 354AEE03.424DC998@none.com


On Sat, 02 May 1998 10:57:24 +0100, R Mullen <none@none.com> wrote:
>> type cd_track_array is array(1..3) of cd_track;
>> new_cd_track:cd_track_array;
>>
>> type cd is
>>         record
>>                 title:string(1..20);
>>                 artist:string(1..20);
>>                 id:new_cd_track;
>>                 tracks:integer;
>>         end record;
>>
>> type cd_array is array(1..3) of cd;
>> new_cd_array:cd_array;
>>
>> begin
>>                 new_cd_array(1):=("qqqqqqqqqqqqqqqqqqqq","qqqqqqqqqqqqqqqqqqqq",("qqqqqqqqqqqqqqqqqqqq","qqqqqqqqqqqqqqqqqqqq",0.34,1),3);
>>                 put(new_cd_array(1).id(1).title);
>>
>  I am specifying the ID of the CD to the array of CD Tracks. I would of
>thought it would work but as of yet it still wont. Although I have asked
>this before the responses weren't really concerning the actual problem.

Your assignment of one CD only contains data for one cd_track; the cd
record contains a new_cd_track (how, I'm not sure; I would expect
you'd have to use a type in the declaration, not a variable, but hey,
whatever works), and a new_cd_track is an array of 3 cd_tracks. So,
your assignment needs to be a bit uglier, along the lines of:
new_cd_array(1):=(title,artist,((cd_track1),(cd_track2),(cd_track3)),tracks);
Note the array aggregate containing the cd_track aggregates.

- Arthur
  (arthurw at bigfoot.com)




       reply	other threads:[~1998-05-02  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <354AEE03.424DC998@none.com>
1998-05-02  0:00 ` Arthur Ward [this message]
1998-05-02  0:00 ` An array of records within an array of records (Still a problem) David C. Hoos, Sr.
1998-05-02  0:00 ` David C. Hoos, Sr.
1998-05-02  0:00 ` Robert Dewar
1998-05-04  0:00 ` Pascal Obry
1998-05-02  0:00 tmoran
1998-05-04  0:00 ` Stephen Leake
1998-05-06  0:00   ` Dr Richard A. O'Keefe
1998-05-06  0:00     ` Robert Dewar
replies disabled

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