From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebe6e2ef707c0384 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s72.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: how to create a record References: <1162523698.802339.225760@h54g2000cwb.googlegroups.com> In-Reply-To: <1162523698.802339.225760@h54g2000cwb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s72 1162531177 12.201.97.213 (Fri, 03 Nov 2006 05:19:37 GMT) NNTP-Posting-Date: Fri, 03 Nov 2006 05:19:37 GMT Date: Fri, 03 Nov 2006 05:19:37 GMT Xref: g2news2.google.com comp.lang.ada:7343 Date: 2006-11-03T05:19:37+00:00 List-Id: markww wrote: > > with Ada.Text_IO; > > type struct_device is > record > major_number : Integer := 0; > minor_number : Integer := 0; > end record; This is a declaration. It goes in a declarative region, between "is" and "begin". > procedure Ada_LinkedList is Like here. > begin > Ada.Text_IO.Put_Line("Hello, world!"); > Ada.Text_IO.Put_Line("just terrible!"); > end Ada_LinkedList; > > I tried creating a record like in the above example, and compiling with > gnatmake but get the error: What you have is a record type declaration. To create a record object you have to declare an object of the type: Object : Struct_Device; Since you declare no objects of the type, the declaration serves no purpose, so you can achieve the same effect by deleting the type declaration. -- Jeff Carter "I soiled my armor, I was so scared." Monty Python & the Holy Grail 71