comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Newbie Question: using Text_IO.Open() to read from standard input
Date: Thu, 13 Oct 2005 01:53:44 -0500
Date: 2005-10-13T01:53:44-05:00	[thread overview]
Message-ID: <CImdnXRAU9blmdPenZ2dnUVZ_tGdnZ2d@comcast.com> (raw)
In-Reply-To: aem3f.2136$y14.566@newsread3.news.pas.earthlink.net

>> to use things from ARM 10.3 "Default Input, Output, and Error Files".
>...
>These procedures read from Current_Input rather than Standard_Input to allow a
>program to read from a file if one if provided and from Standard_Input if not:
  Also, sometimes you have code that takes a file, eg
    procedure Process_Data(F : in Ada.Text_IO.File_Type) is ...
and you want to call it with a named file or with Standard Input
    Default_Data : Ada.Text_IO.File_Type;
  begin
    if ... then
      Process_Data(Ada.Text_IO.Standard_Input);
    else
      Ada.Text_IO.Open(Default_Data, ...
      Process_Data(Default_Data);
      Ada.Text_IO.Close(Default_Data);
    end if;



  reply	other threads:[~2005-10-13  6:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13  0:49 Newbie Question: using Text_IO.Open() to read from standard input pamela.lum
2005-10-13  1:30 ` Anh Vo
2005-10-13  1:48   ` pamela.lum
2005-10-13  1:56     ` Anh Vo
2005-10-13 16:14     ` Martin Krischik
2005-10-13  1:58 ` tmoran
2005-10-13  2:02   ` pamela.lum
2005-10-13  2:19     ` Anh Vo
2005-10-13  5:26   ` Jeffrey R. Carter
2005-10-13  6:53     ` tmoran [this message]
2005-10-13  3:15 ` Steve
replies disabled

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