[comp.lang.ada] Terminal Column Number

sampson@cod.NOSC.MIL (Charles H. Sampson) (07/30/90)

      Another article, titled TEXT_IO Anomaly, pointed out that the column
number for STANDARD_OUTPUT is unaffected by STANDARD_INPUT.  In particular,
the carriage return that terminates an input line does not set the column
number for STANDARD_OUTPUT to 1, even though the cursor is now blinking at
the left margin.

     From the ensuing discussion it seems clear to me that this behaviour is
a correct interpretation of the LRM.  My question is, "Is it useful?"  Does
anyone know of a meaningful piece of code that makes use of the column num-
ber for STANDARD_OUTPUT as it is currently implemented by (apparently) all
compiler writers?  (I don't know how other readers feel, but the less toy-
like an example is the more I find it convincing.)

                            Charlie Sampson

GDAU100@BGUVM.BITNET ("Jonathan B. Owen") (08/01/90)

In my original posting I brought up the issue of two internal files
(STANDARD_INPUT and STANDARD_OUTPUT) accessing the same external file
(read terminal).

I agree that the implementation is in accordance to the LRM.  When
accessing STANDARD_INPUT, the STANDARD_OUTPUT internal file is not
affected in any way.  Still, I am left with the problem I mentioned
at first.  The COL of STANDARD_OUTPUT does not reflect the position
of the cursor.  The difficulty is that I have no way of setting
the COL without producing an extra, unwanted CR.  It is one thing
to maintain internal-file independence, and another not to enable
a higher level to do so...

As to a concrete example for relying on COL of STANDARD_OUTPUT,
after the user types a "LIST" command (and presses return) I make
a recursive call to a procedure for printing a certain tree structure,
each time indenting the COL by 4.  The procedure uses the current
value of COL for printing multiple lines at the specific indent level.
The first line after the user's input is printed incorrectly.

Maybe it would be sensible to enable access to the counters so that
one can implement external-file dependency above TEXT_IO.

                                             Jonathan Owen

______________________________________________________________________________
  (--)    /--)     /-(\                 Email: gdau100@bguvm (bitnet)
  \ /    /--K      | \|/\   /\/) /|-\   Snail: 55 Hovevei Zion
  _/_/o /L__)_/o \/\__/  \X/  \_/ | |_/        Tel-Aviv, 63346  ISRAEL
 (/        Jonathan B. Owen             Voice: (03) 281-422

 Point of view:  A chicken is the means by which an egg reproduces an egg.
______________________________________________________________________________