comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <maa@liacc.up.pt>
To: comp.lang.ada@ada-france.org
Subject: Re: Stream_Element_Array 2 String
Date: Fri, 26 Mar 2004 18:04:22 +0000
Date: 2004-03-26T18:04:22+00:00	[thread overview]
Message-ID: <mailman.145.1080323447.327.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <d01dd435fa30e7b52e5734cd25c02ef4@localhost.talkaboutprogramming.com>

> Im using Ada.Streams.Stream_IO for read block of files and i can convert
> a Stream_Element_Array to String type.
> how can i do?

Ada.Unchecked_Conversion is your friend.

But make sure you need that, instead of basic stream I/O e.g.

with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;

procedure Strstr is
   F : File_Type;
   S3 : String (1 .. 3);
begin
   Create (F);
   String'Write (Stream (F), "abc");
   Reset (F);
   S3 := "***";
   Set_Mode (F, In_File);
   String'Read (Stream (F), S3);
   pragma Assert (S3 = "abc");
end;




  reply	other threads:[~2004-03-26 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-26 17:30 Stream_Element_Array 2 String Shaddow
2004-03-26 18:04 ` Marius Amado Alves [this message]
2004-03-27  8:24   ` Simon Wright
2004-03-29  7:50     ` Duncan Sands
2004-03-29 19:00       ` Simon Wright
2004-03-31  9:32       ` Pascal Obry
replies disabled

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