- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want my console application to display a varying number at the same location in the current output line, i.e. overprint it. Example:
DO I = 1, n
! do something
WRITE (*, '(A, I3)') 'Loop count = ', n
END DO
IOW I don't want each loop count report to create a new line (thus scrolling out of the window when n is large)--I want it to keep updating the same line. I know how to do this using Quickwin or API routines, but I desire standard Fortran.
Once upon a time I could accomplish this using carriage control: the output string would be '+Loop count = ', n. But this awkwardly requires the compiler switch '/ccdefault:fortran'. Worse, I understand that carriage control has been eliminated from standard Fortran.
So, how can I do this now?
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Previously, the behaviour was completely processor dependent. It only applied to devices that were considered by the processor to do "printing" (which was a concept that had nothing to do with the PRINT statement). These days regarding the console as a printer is a bit of a stretch.
So if you just pretend that your current processor deems no devices to do "printing", then you haven't lost anything...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have lost the ability to write data to a window and overstrike the previous line using only standard features. The assumption that carriage control (although possibly misnamed) was only useful for devices considered to do "printing", if "printing" does not include the console, is faulty. I "print" to the console all the time. Most of my programs are still based on the user watching the screen to see what happens, and he is often watching text in a console, not a dialog box, display of a text file, or other. I can't pretend that my current processor doesn't need to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dboggs wrote:
I have lost the ability to write data to a window and overstrike the previous line using only standard features.
I do not think that we ever had that ability as a standard Fortran feature. If a printer had the capability to interpret certain character code sequences as information to control the printer rather than to print them out, Fortran helped you to output those characters. The line printers of the 1960s had certain conventions, such as using the first character as a printer control character. Other printers, such as the DEC LA-50, and hundreds of models of "ANSI" CRT terminals supported rather elaborate control strings, for shifting into and out of alternate (e.g., Greek) character sets, positioning the printer head, ejecting a sheet, etc. I should not be surprised if there was a printer that could be queried about how much ink was in the tank with a special control sequence.
See http://man7.org/linux/man-pages/man4/console_codes.4.html for a description of the control codes that are understood by the Linux console. In MSDOS, the screen driver ANSI.SYS was used to allow a limited set of control sequences on CRT screens. Similar utilities are available for use in current Windows versions; example: https://code.google.com/p/mintty/ .
However, in all these cases, Fortran did not have any knowledge of what those sequences did, nor did it attempt to interpret any of those sequences. That job was assigned to a filter program. When AT&T came out with Unix, they provided the asa utility to implement a small set of control characters. Linux still provides asa, and you can obtain a version for Windows. Lahey/Fujitsu Fortran provided the fot filter.
In summary, there was always a filter-translator between the Fortran program output and the output hardware. That filter could be in the firmware of the printer or terminal, or it could be a utility program that ran on the computer.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »