title: How do I format a PRINT or WRITE statement to overwrite the current line on the console screen?
body: <p>I want to display the progress of a calculation done with a DO-loop, on the console screen. I can print out the progress variable to the terminal like this:</p>
  
  <pre><code>PROGRAM TextOverWrite_WithLoop
  IMPLICIT NONE
  INTEGER :: Number, Maximum = 10
   DO Number = 1, MAXIMUM   
    WRITE(*, 100, ADVANCE='NO') REAL(Number)/REAL(Maximum)*100     
    100 FORMAT(TL10, F10.2)
    ! Calcultations on Number     
   END DO    
  END PROGRAM TextOverWrite_WithLoop
  </code></pre>
  
  <p>The output of the above code on the console screen is:</p>
  
  <p><strong>10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00
  90.00 100.00</strong></p>
  
  <p>All on the same line, wrapped only by the console window.</p>
  
  <p>The <strong>ADVANCE='No'</strong> argument and the <strong>TL10</strong> (tab left so many spaces) edit descriptor works well to overwrite text on the same line, e.g. the output of the following code:</p>
  
  <pre><code>WRITE(*, 100, ADVANCE='NO') 100, 500
  100 FORMAT(I3, 1X, TL4, I3)
  </code></pre>
  
  <p>Is:</p>
  
  <p><strong>500</strong></p>
  
  <p>Instead of:</p>
  
  <p><strong>100 500</strong></p>
  
  <p>Because of the TL4 edit descriptor.</p>
  
  <p>From these two instances one can conclude that the WRITE statement cannot overwrite what has been written by another WRITE statement or by a previous execution of the same WRITE satement (as in a DO-loop).</p>
  
  <p>Can this be overcome somehow?</p>
  
  <p>I am using the FTN95 compiler on Windows 7 RC1. (The setup program of the G95 compiler bluescreens Windows 7 RC1, even thought it works fine on Vista.)</p>
  
  <p>I know about the question <a href="https://stackoverflow.com/questions/661975/supressing-line-breaks-in-fortran-95-write-statements">Supressing line breaks in Fortran 95 write statements</a>, but it does not work for me, because the answer to that question means new ouput is added to the previous output on the same line; instead of new output overwriting the previous output.</p>
  
  <p>Thanks in advance.</p>