comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: How To Write A Record To File ?
Date: Fri, 8 Dec 2017 08:57:22 -0800 (PST)
Date: 2017-12-08T08:57:22-08:00	[thread overview]
Message-ID: <07f2884a-0e7e-4afa-8c0e-d415fb9b2299@googlegroups.com> (raw)
In-Reply-To: <172e751b-4292-4b9f-a047-869197b0a787@googlegroups.com>

On Friday, December 8, 2017 at 8:41:57 AM UTC-8, pat...@spellingbeewinnars.org wrote:
> Hi Adamagica
> 
> Please see this failing program:
> 
> -Patrick
> 
>        with sequential_io ;
>        procedure compute_total_population is
>         type foo_type is
>         record
>           moo              : integer ;
>           boo              : integer ;
>         end record ;
>  
>         foo                : foo_type ;
>        -- will fail here with error:
>        -- expect valid subtype mark to instantiate "Element_Type"
>         package si is        new sequential_io(foo);

Your basic is error to instantiate with an object of record instead of record type. Here is the correct instantiation.

   package SI is new Ada.Sequential_IO (Foo_Type);

Anh Vo

  reply	other threads:[~2017-12-08 16:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 16:04 How To Write A Record To File ? patrick
2017-12-08 16:25 ` AdaMagica
2017-12-08 16:40   ` patrick
2017-12-08 16:41   ` patrick
2017-12-08 16:57     ` Anh Vo [this message]
2017-12-08 17:11       ` Anh Vo
2017-12-08 17:29         ` patrick
2017-12-08 16:43 ` Dmitry A. Kazakov
2017-12-08 16:53   ` patrick
2017-12-08 17:35 ` Dennis Lee Bieber
2017-12-08 18:01   ` Simon Wright
2017-12-08 23:06     ` patrick
2017-12-08 23:06       ` Victor Porton
2017-12-08 23:28       ` Simon Wright
2017-12-08 23:31         ` patrick
2017-12-09  8:03           ` Usenet (Was: How To Write A Record To File ?) Jacob Sparre Andersen
2017-12-09  9:08             ` Usenet Simon Wright
2017-12-09 14:38               ` Usenet Björn Lundin
2017-12-09 11:34           ` How To Write A Record To File ? Spiros Bousbouras
replies disabled

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