From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org>
Subject: Re: Defaulting to Standard_Output
Date: Fri, 24 Oct 2008 03:57:54 GMT
Date: 2008-10-24T03:57:54+00:00 [thread overview]
Message-ID: <6JbMk.402762$yE1.46044@attbi_s21> (raw)
In-Reply-To: <57dcc958-4b4c-4282-82b3-5c348895c6ad@b2g2000prf.googlegroups.com>
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
next prev parent reply other threads:[~2008-10-24 3:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 23:10 Defaulting to Standard_Output deadlyhead
2008-10-24 0:16 ` Jeffrey R. Carter
2008-10-24 1:14 ` deadlyhead
2008-10-24 1:49 ` Adam Beneschan
2008-10-24 2:57 ` deadlyhead
2008-10-24 3:57 ` Jeffrey R. Carter [this message]
2008-10-24 6:28 ` deadlyhead
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox