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

Ask A Question

Stats

  • Questions 272k
  • Answers 272k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can add additional selector with comma (,) as specified… May 13, 2026 at 2:02 pm
  • Editorial Team
    Editorial Team added an answer Large file transfers are indeed a problem in wcf and… May 13, 2026 at 2:02 pm
  • Editorial Team
    Editorial Team added an answer [DataContract] public class MyObject { } [ServiceContract] public interface IMyService… May 13, 2026 at 2:02 pm

Related Questions

This is a common problem for all developers, I am looking for the best
Questions: What is the best practice for keeping track of a thread's progress without
I'm making a game in C# and I want to display the progress (movements
I'm using a progress bar to display the battery status. If the user clicks

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.