Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 372265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:11:38+00:00 2026-05-12T14:11:38+00:00

I want to display the progress of a calculation done with a DO-loop, on

  • 0

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:

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

The output of the above code on the console screen is:

10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00
90.00 100.00

All on the same line, wrapped only by the console window.

The ADVANCE=’No’ argument and the TL10 (tab left so many spaces) edit descriptor works well to overwrite text on the same line, e.g. the output of the following code:

WRITE(*, 100, ADVANCE='NO') 100, 500
100 FORMAT(I3, 1X, TL4, I3)

Is:

500

Instead of:

100 500

Because of the TL4 edit descriptor.

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).

Can this be overcome somehow?

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.)

I know about the question Supressing line breaks in Fortran 95 write statements, 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.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:11:39+00:00Added an answer on May 12, 2026 at 2:11 pm

    There is no solution to this question within the scope of the Fortran standards. However, if your compiler understand backslash in Fortran strings (GNU Fortran does if you use the option -fbackslash), you can write

      write (*,"(A)",advance="no") "foo"
      call sleep(1)
      write (*,"(A)",advance="no") "\b\b\bbar"
      call sleep(1)
      write (*,"(A)",advance="no") "\b\b\bgee"
      call sleep(1)
      write (*,*)
      end
    

    This uses the backslash character (\b) to erase previously written characters on that line.

    NB: if your compiler does not understand advance="no", you can use related non-standard tricks, such as using the $ specifier in the format string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a progress animation while updatepanel's work being done, but without
I have a progress dialog and I want to display text message like below
I want the display the progress dialog like activity indicator as like in iPhone,
hey i want to display a loading progress using ProgressDialog on my aplication, but
I have db with this table (TableToDo): http://goo.gl/NlTEk I want display all records in
In the header of the django admin, I want display a link. This link
I want to display images in a TableView . I can display one image
I want to display result of this javascript in a label control on my
In Silverlight, I want to display progress of, for example, an uploading process as
I want to display a progress bar/wheel, when doing some process, for instance, on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.