comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Defaulting to Standard_Output
Date: Thu, 23 Oct 2008 18:49:14 -0700 (PDT)
Date: 2008-10-23T18:49:14-07:00	[thread overview]
Message-ID: <7decfc0d-26ef-4539-8d2e-7e0bce88cfbd@r37g2000prr.googlegroups.com> (raw)
In-Reply-To: 3a558b10-da3e-4dfa-93e1-573170dfa565@x1g2000prh.googlegroups.com

On Oct 23, 6:14 pm, deadlyhead <deadlyh...@gmail.com> wrote:
> On Oct 23, 5:16 pm, "Jeffrey R. Carter"
>
> <spam.jrcarter....@spam.acm.org> wrote:
> > deadlyhead wrote:
>
> > > If anybody has a better way of handling defaulting to Standard_Output,
> > > I'd like to see it.  This works for me, and seems elegant enough.  It
> > > avoids a lot of messy conditionals in the body, anyway.
>
> > This is what Ada.Text_IO.Set_Output is for.

> I looked over Set_Output in the ARM and I went back looking for it in
> the comp.lang.ada, and it looks to me that Set_Output will direct all
> Put statements to Outfile if a file isn't designated, rather than
> having calls of Put (Outfile, Item) appear in Standard_Output.
>
> This doesn't appear to be the functionality I'm looking for.  If no
> file is specifically named for Outfile, I want all output to appear on
> the terminal.  If a file is named for Outfile, then direct output to
> that.  Using Set_Output (Outfile), wouldn't I still need a Create
> statement for Outfile?

Well, yes.  If you want to create a file, you need to call Create.
There isn't anything in the Ada libraries that I know of that will
create a file without you telling it to.  But why would that be a
problem?  If Name /= "", call Create, then call Set_Output.

                              -- Adam




  reply	other threads:[~2008-10-24  1:49 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 [this message]
2008-10-24  2:57       ` deadlyhead
2008-10-24  3:57         ` Jeffrey R. Carter
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