- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to do non-advancing output from a FORTRAN program (console application) on my terminal (screen). The standard write options for non-advancing output work on files, but not on my terminal. Did anybody solve this already?
Reiner
I'm trying to do non-advancing output from a FORTRAN program (console application) on my terminal (screen). The standard write options for non-advancing output work on files, but not on my terminal. Did anybody solve this already?
Reiner
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What exactly are you trying to accomplish, and on what platform(s)?
James
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
attached is a sample program which shows my problem. I want to have the output always in the same line, with only the number changing. As it is now, every WRITE statements creates a new line on the screen.
I'm working with Windows 2000 on a Intel P4 system, using Visual Fortran 6.6.
attached is a sample program which shows my problem. I want to have the output always in the same line, with only the number changing. As it is now, every WRITE statements creates a new line on the screen.
I'm working with Windows 2000 on a Intel P4 system, using Visual Fortran 6.6.
program nonadvancing integer i,j,jj,jjj,ipercent jj = 10000000 do i = 1,100 ! loop do j = 1,jj jjj = j + i end do ipercent = jjj - jj WRITE(*,'(a,i4,a)') '+ ',ipercent,'% executed ' end do end program nonadvancing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're not using nonadvancing I/O - that would be if you did a WRITE with ADVANCE='NO' in the control list.
What you have here is Fortran carriage control. The default carriage control interpretation is 'LIST', so the '+' is just another character. You need to have the unit opened with CARRIAGECONTROL='FORTRAN'. Since you are using unit *, the only way to do that is to compile with the option /ccdefault:fortran (this is also under Project..Settings..Fortran..Run-Time Behavior, I think.)
Steve
What you have here is Fortran carriage control. The default carriage control interpretation is 'LIST', so the '+' is just another character. You need to have the unit opened with CARRIAGECONTROL='FORTRAN'. Since you are using unit *, the only way to do that is to compile with the option /ccdefault:fortran (this is also under Project..Settings..Fortran..Run-Time Behavior, I think.)
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Steve!
This was the right tip. Just adding the '/ccdefault:fortran' option under "Project .. Settings .. Fortran" solves the problem. There is no need to use the ADVANCE='no' specifier, in fact it is not accepted to add it in the WRITE statement in this context (compiler error).
Thanks again, Reiner
This was the right tip. Just adding the '/ccdefault:fortran' option under "Project .. Settings .. Fortran" solves the problem. There is no need to use the ADVANCE='no' specifier, in fact it is not accepted to add it in the WRITE statement in this context (compiler error).
Thanks again, Reiner

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page