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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,479138db2311e415 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 13 Oct 2005 01:53:44 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Newbie Question: using Text_IO.Open() to read from standard input References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 13 Oct 2005 01:53:44 -0500 NNTP-Posting-Host: 24.6.102.223 X-Trace: sv3-FXIDgIfGOnUR5Xy8Tzb86/ctCfpKHsUZ9k8pln31p+P21amNv/ASntRkKDrpWvk5GKIOW0Br9faXlZc!2iXg/iIz9+fDTPiHBe/4RCrImo5NzpQp6jPTm4qQ4kq/lrd4JOIfhVcqrdxA1nOba+RrWyxwu0aV!C2OTVwa9ZsF+iA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5588 Date: 2005-10-13T01:53:44-05:00 List-Id: >> 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;