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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Text_IO, was: Re: Something I don't understand Date: Thu, 20 Feb 2014 13:05:56 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4a3e55f6-9f54-4084-9f37-96efd4b0d349@googlegroups.com> <0b358700-871b-4603-addd-65e07c7d59e5@googlegroups.com> Injection-Date: Thu, 20 Feb 2014 13:05:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e458ff8b81bc0c159989eb0e36c6e372"; logging-data="6501"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8D33kcwNE2oFgGnhSCGkUl0rVnVXLlNI=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:uRNWRKWtAjT59wchl3VeUD7HQZ4= Xref: news.eternal-september.org comp.lang.ada:18704 Date: 2014-02-20T13:05:56+00:00 List-Id: On 2014-02-20, Niklas Holsti wrote: > On 14-02-20 03:09 , Simon Clubley wrote: >> >> Are you familiar with the VMS $FAO directive (which is the way VMS does >> template formatting) ? >> >> Background material on $FAO is at: >> >> http://h71000.www7.hp.com/doc/82final/4527/4527pro_047.html >> >> The table of formatting directives are at the bottom of that page. >> >> Of interest is the directive "!%S" which inserts either "S" or "s" if >> the most recent numeric value was not one, the directive "!n%C" which >> inserts a specific string if the previous numeric field value matches >> the "n" condition and the "!%E" directive which inserts a string if the >> previous numeric field value did _not_ match a previous "!n%C" test. >> >> Something like that would handle this problem rather cleanly. > > Cleanly? I would call those directives "line-noise formatting". Trying > to embed logical decisions into the template string is yucky. > Actually, when I said "cleanly", I meant the general approach of using conditional formatting directives, not the specific $FAO syntax. > Concatenating conditional string expressions in Ada is a lot cleaner IMO. > That works in some cases, but it doesn't work when you are trying to produce formatted reports with lots of columns with specific widths and formatting required. It also depends on what you are wanting to do with the template capability. Are you wanting to output free-form text with various parameters inserted or are you trying to format a detailed report ? I could see myself using it to do both. What about everyone else here ? Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world