From: je@bton.ac.uk (John English)
Subject: Re: Simple Stream_IO question
Date: 1996/10/22
Date: 1996-10-22T00:00:00+00:00 [thread overview]
Message-ID: <54icjl$991@saturn.brighton.ac.uk> (raw)
In-Reply-To: Pine.LNX.3.91.961021132826.300A-100000@e229b-1.ensu.ucalgary.ca
John Raquet (jfraquet@acs.ucalgary.ca) wrote:
: If someone could show me what I'm doing wrong in the following code
: sample I'd appreciate it:
: -----------------
: with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
: procedure Foo is
: F : Float;
: I : Integer;
: File : File_Type;
-- You also need:
Strm : Stream_Access;
: begin
: Open(File, In_File, "foo.adb");
-- And now:
Strm := Stream(File); -- create a stream based on the file
: Float'Read(File, F);
: Integer'Read(File, I);
-- These two lines should read:
Float'Read(Strm, F);
Integer'Read(Strm, I);
: Close(File);
: end Foo;
---------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.comp.it.bton.ac.uk/je
Dept. of Computing | fax: (+44) 1273 642405
University of Brighton |
---------------------------------------------------------------
prev parent reply other threads:[~1996-10-22 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-10-21 0:00 Simple Stream_IO question John Raquet
1996-10-21 0:00 ` Robert Dewar
1996-10-22 0:00 ` Norman H. Cohen
1996-10-22 0:00 ` John English [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox