[comp.lang.ada] Help! DEC/Ada TEXT_IO & QIO don't get along

tynor@pyr.gatech.EDU (Steve Tynor) (02/10/89)

Help! I need a way to flush the TEXT_IO.STANDARD_OUTPUT file so that I
can switch over to using more primative QIO calls (for screen IO,
cursor motion, etc.) The DEC/Ada Programmer's Runtime Reference Manual
(sec. 2.6.5.2) says that TEXT_IO output is buffered until a NEW_LINE or
NEW_PAGE. However, when I try the following:

     TEXT_IO.PUT_LINE ("this string gets eaten");
     QIO.PUT ("this string gets written where I expect the other");
     -- NOTE: the QIO package is not defined by DEC - I wrote it myself.

things do not behave as documented.  Subsequent calls to TEXT_IO.PUT*
will flush the buffered string, but it's too late... What I need is a
way to explicitly flush STANDARD_OUTPUT. I can't CLOSE and then OPEN
(STANDARD_OUTPUT is a function not a FILE_TYPE, and CLOSE/OPEN treats
the file as in-out). Please don't tell me not to mix TEXT_IO and QIO:
I need unbuffered QIO for fancy screen processing and buffered TEXT_IO
is much faster for other kinds of output.

Any DEC specific ways to flush STANDARD_OUT?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
No problem is so formidable that you can't just walk away from it.
                     
    Steve Tynor
    Georgia Tech Research Institute
    tynor@gitpyr.gatech.edu

dd@sei.cmu.edu (Dennis Doubleday) (02/10/89)

(Steve Tynor) writes:

>Help! I need a way to flush the TEXT_IO.STANDARD_OUTPUT file so that I
>can switch over to using more primative QIO calls (for screen IO,
>cursor motion, etc.) The DEC/Ada Programmer's Runtime Reference Manual
>(sec. 2.6.5.2) says that TEXT_IO output is buffered until a NEW_LINE or
>NEW_PAGE. However, when I try the following:
>
>     TEXT_IO.PUT_LINE ("this string gets eaten");
>     QIO.PUT ("this string gets written where I expect the other");
>     -- NOTE: the QIO package is not defined by DEC - I wrote it myself.

Text_IO and QIO cooperated nicely in a text editor I worked on that
used Text_IO in line editor mode and QIOs in full-screen editor mode.
I didn't experience this problem.  However, I used the QIO interface
calls supplied by DEC in the package STARLET.  Are you using these?
If not, perhaps your problem is in the QIO package you wrote.

Dennis Doubleday  (dd@sei.cmu.edu)                     _   /|
Software Engineering Institute                         \'o.O'
Carnegie Mellon University                ACK! PTHFT!  =(___)=
Pittsburgh, PA 15213  (412)268-5873                       U