From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 4 Feb 93 04:48:00 GMT From: agate!spool.mu.edu!olivea!charnel!rat!koko.csustan.edu!nic.csu.net!vmsa.i s.csupomona.edu!marasigan@ucbvax.Berkeley.EDU (GABRIEL MARASIGAN PA) Subject: question on constant arrays Message-ID: <3FEB199320484448@vmsa.is.csupomona.edu> List-Id: Is it possible to declare an array of record types, with a string within the record say like in 'C': struct mytype { char *Name; int T; }; struct mytype foo[] = {{"Hi", 1}, {"There!", 2}}; I have tried: type MY_TYPE(Size : positive := 1) is record Name : STRING(1..Size); T : INTEGER; end record; type MY_ARRAY is array(positive range <>) of MY_TYPE; Foo : constant MY_ARRAY := ((size => 2, Name => "Hi", T => 1)....) ? and the compiler balked at me. It seems that you can do: NAME : constant STRING := "Hi"; and since type STRING is declared to be: type STRING is array (positive range <>) of CHARACTER; the compiler shouldn't have any problems figuring out how many MY_TYPE records I am actually putting in my constant array. If it could figure it out for strings, why not for MY_TYPE? Or is the problem with MY_TYPE's 'Size' need to be bound before hand? Or is it because the compiler 'knows' that my project is due in 2 days? Thanks in advance for any info. Gabriel marasigan@csupomona.edu