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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b5982b7c8eb7a4fc X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Simple Stream_IO question Date: 1996/10/21 Message-ID: #1/1 X-Deja-AN: 191095014 references: organization: New York University newsgroups: comp.lang.ada Date: 1996-10-21T00:00:00+00:00 List-Id: John provides the following incorrect program: with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; procedure Foo is F : Float; I : Integer; File : File_Type; begin Open(File, In_File, "foo.adb"); Float'Read(File, F); Integer'Read(File, I); Close(File); end Foo; You have to pay attention to types in Ada, the Read attribute has the profile 6 S'Read S'Read denotes a procedure with the following specification: 7 procedure S'Read( Stream : access Ada.Streams.Root_Stream_Type'Class; Item : out T) But your first argument is of type Streams.Stream_IO.File_Type which is completely wrong. You ned to use Streams.Stream_IO.Stream!