comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: how to designate standard input from another file
Date: 2000/06/05
Date: 2000-06-05T17:24:53+00:00	[thread overview]
Message-ID: <8hgnp5$r7k$1@wanadoo.fr> (raw)
In-Reply-To: amQ_4.2$m22.237@wdc-read-01.qwest.net

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]


Terry Westley <twestley@buffalo.veridian.com> a �crit dans le message : amQ_4.2$m22.237@wdc-read-01.qwest.net...
> Something like this would be nice except that File_Type is
> limited private:
>
> declare
>    File : Ada.Text_IO.File_Type;
> begin
>    if File_Name = "-" then
>       File := Ada.Text_IO.Standard_Input;
>    else
>       Ada.Text_IO.Open (File, In_File, File_Name);
>    end if;
> end;
>
Do it the other way round, i.e. read from Standard_Input, and redirect it if necessary:
 declare
    File : Ada.Text_IO.File_Type;
 begin
    if File_Name /= "-" then
       Ada.Text_IO.Open (File, In_File, File_Name);
       Ada.Text_IO.Set_Input (File);
    end if;
 end;








  reply	other threads:[~2000-06-05  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-05  0:00 how to designate standard input from another file Terry Westley
2000-06-05  0:00 ` Jean-Pierre Rosen [this message]
2000-06-05  0:00   ` Terry Westley
replies disabled

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