Previous: prsqst Up: ../plot79_p.html Next: prssec


PRSRTY

       SUBROUTINE  PRSRTY (RTYFLG)
 C$    (Parse Internal - Retype Command)
 C$    When help has been offered, or recognition performed, or  a
 C$    CTL-H or CTL-R  entered, the current  input buffer must  be
 C$    retyped, preserving its original appearence with respect to
 C$    continuation lines.
 C$
 C$    The single argument RTYFLG has one of the following values:
 C$
 C$    RTYNEW....Retype entire  command beginning on  a  new line.
 C$    RTYOVR....Retype LAST  line  of command  on  current  line,
 C$              erasing the previous line contents.
 C$
 C$    RTYNEW is trivial to simulate, since we can just output the
 C$    lines normally.
 C$
 C$    RTYOVR is  harder,  since it  requires  terminal  dependent
 C$    processing.  On most ASCII display terminals, the  required
 C$    commands are:
 C$
 C$    Retype current line:
 C$         <Cursor to BOL> <Erase from cursor to EOL> <line contents>
 C$
 C$    Position to beginning of previous line:
 C$         <Cursor to BOL> <Erase from cursor to EOL>
 C$         <Cursor Up> <Erase from cursor to EOL>
 C$
 C$    The  actual  ASCII  byte  sequences  for  these  vary  from
 C$    terminal to terminal.  Here are some examples:
 C$
 C$        Command         DEC VT52       DEC VT100      Televideo
 C$    ---------------     --------       ------------   ---------
 C$    <Cursor to BOL>     CR             CR             CR
 C$    <Erase from
 C$    cursor to EOL>      ESC K          ESC LBRACK K   ESC T
 C$    <Cursor Up>         ESC A          ESC LBRACK A   ESC j
 C$
 C$    There is a further  complication that some terminal  models
 C$    at high baud  rates require padding  characters to force  a
 C$    delay to enable the function to be completed properly.   We
 C$    shall assume  that such  padding is  not required  in  this
 C$    simple interface.   The command  tables are  simple  enough
 C$    that padding characters could easily be added transparently
 C$    to the code.
 C$
 C$    If the output is  not directed to  a terminal, then  RTYOVR
 C$    should function like RTYNEW.  Similarly, if the host cannot
 C$    support output cursor-addressable  terminals, or output  at
 C$    the end of  the current line,  then RTYOVR should  function
 C$    like RTYNEW.
 C$
 C$    If FORTRAN input is used, then  after the user has typed  a
 C$    line, it must have been ended by a carriage return, and the
 C$    cursor is therefore one line below the line in question, so
 C$    we need the command sequence  to position to the  beginning
 C$    of the  previous  line.  If  character-at-a-time  input  is
 C$    used, then the cursor is on the current line, so we can get
 C$    by with erasing from BOL to EOL.
 C$
 C$    If  the   host  software   system  supports   it,  a   more
 C$    sophisticated version  of this  routine could  use  inquiry
 C$    functions to  determine at  runtime the  terminal type  and
 C$    current  cursor  position,   then  send  out   specifically
 C$    tailored commands.
 C$    (19-NOV-82)