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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:1646:: with SMTP id a67-v6mr615473ita.43.1528269294436; Wed, 06 Jun 2018 00:14:54 -0700 (PDT) X-Received: by 2002:a9d:5788:: with SMTP id q8-v6mr80265oth.3.1528269294194; Wed, 06 Jun 2018 00:14:54 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder3.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!u74-v6no1628099itb.0!news-out.google.com!z3-v6ni1277iti.0!nntp.google.com!u74-v6no1628097itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 6 Jun 2018 00:14:54 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.189.195.101; posting-account=3zVVBwoAAAC7BSMfgNP7DSbqU9urpt40 NNTP-Posting-Host: 87.189.195.101 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <8d88b7fa-3939-43d5-9de3-e16eee656a15@googlegroups.com> Subject: Re: how to read status of current_output From: mario.blunk.gplus@gmail.com Injection-Date: Wed, 06 Jun 2018 07:14:54 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:52951 Date: 2018-06-06T00:14:54-07:00 List-Id: On Tuesday, June 5, 2018 at 7:24:37 PM UTC+2, G. B. wrote: > wrote: > > Hello, > > > > I have a program that frequently changes the current_output (with > > statement set_output (blabla)). During the course of the program I want > > to read the status, means the current value of current_output. I tried this code: > > > > handle_1, handle_2 : ada.text_io.file_type; > > > > if ada.text_io.file_type (current_output) = handle_1 then ... > > Can you wrap Set_Output in a subprogram that stores the state? I was thinking about this approach, but it would introduce another variable that keeps track of the current output. The solution with name (current_output) seems the easiest and most elegant. Thanks anyway !