From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:15d3:: with SMTP id o19mr459617qkm.481.1623344764288; Thu, 10 Jun 2021 10:06:04 -0700 (PDT) X-Received: by 2002:a25:2b05:: with SMTP id r5mr9254066ybr.465.1623344764145; Thu, 10 Jun 2021 10:06:04 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 10 Jun 2021 10:06:03 -0700 (PDT) In-Reply-To: <331aa8fb-271a-4a3a-b95e-d10733cbc404n@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=94.60.6.132; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY NNTP-Posting-Host: 94.60.6.132 References: <331aa8fb-271a-4a3a-b95e-d10733cbc404n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Is it possible to redirect text output to a String or Unbounded_String? From: Marius Amado-Alves Injection-Date: Thu, 10 Jun 2021 17:06:04 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:62169 List-Id: So many overcomplicated "solutions" given here, streams, command calls... Simply write your own Put procedure which output you can redirect either to the terminal or to an Unbounded_String. package Redirectionable_Output is Data: Unbounded_String; To_Variable: Boolean; procedure Put (C: Character); end;