From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: how to create a record
Date: Fri, 03 Nov 2006 05:19:37 GMT
Date: 2006-11-03T05:19:37+00:00 [thread overview]
Message-ID: <JjA2h.266289$1i1.117570@attbi_s72> (raw)
In-Reply-To: <1162523698.802339.225760@h54g2000cwb.googlegroups.com>
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
next prev parent reply other threads:[~2006-11-03 5:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 3:14 how to create a record markww
2006-11-03 4:48 ` Jeffrey Creem
2006-11-03 5:29 ` Jeffrey R. Carter
2006-11-03 7:51 ` Maciej Sobczak
2006-11-03 5:00 ` jimmaureenrogers
2006-11-03 5:19 ` Jeffrey R. Carter [this message]
2006-11-03 11:51 ` Martin Krischik
2006-11-03 16:56 ` Pascal Obry
2006-11-04 3:09 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox