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,624c77c4e3ffaa2 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Defaulting to Standard_Output References: <3a558b10-da3e-4dfa-93e1-573170dfa565@x1g2000prh.googlegroups.com> <7decfc0d-26ef-4539-8d2e-7e0bce88cfbd@r37g2000prr.googlegroups.com> <57dcc958-4b4c-4282-82b3-5c348895c6ad@b2g2000prf.googlegroups.com> In-Reply-To: <57dcc958-4b4c-4282-82b3-5c348895c6ad@b2g2000prf.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <6JbMk.402762$yE1.46044@attbi_s21> NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1224820674 12.201.97.213 (Fri, 24 Oct 2008 03:57:54 GMT) NNTP-Posting-Date: Fri, 24 Oct 2008 03:57:54 GMT Organization: AT&T ASP.att.net Date: Fri, 24 Oct 2008 03:57:54 GMT Xref: g2news1.google.com comp.lang.ada:2482 Date: 2008-10-24T03:57:54+00:00 List-Id: deadlyhead wrote: > > This is not what I want. I want all output of the program to go to > Standard_Output if no name is given for Outfile. It's like if `cat` > had an option '-o' that designated an output file. `cat something.txt > -o outfile.txt` = `cat something.txt > outfile.txt`, but `cat > something.txt` outputs to the terminal. That's the type of > functionality that I want. It works like this: if File_Name /= "" then Create (File); Set_Output (File); end if; -- call Put, Put_Line, and New_Line without a File parameter if File_Name /= "" then Close (File); end if; If the user specifies a file, then output goes to that file. If he doesn't, then output goes to Standard_Output. -- Jeff Carter "When danger reared its ugly head, he bravely turned his tail and fled." Monty Python and the Holy Grail 60