- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone help me understand what these lines of code mean? (This is an old program using F77 that I inherited.)
PRINT 99036 , 155 , 50 , 74 ! Erase screen
PRINT 99036 , 155 , 63 , 51 , 108 ! Set to 80 columns
PRINT 99036 , 155 , 53 , 59 , 49 , 72 ! Set cursor at beginning of line 5
99036 FORMAT (X,5A1)
The result of this code is the corresponding ASCII characters (except for 155, which should be "›") being printed on the screen:
▒2J
▒?3l
▒5;1H
Based on the comments, I gather that these were intended to modify the console display, but I don't understand how.
What is the meaning of the "5A1" in the format list?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unless the screen control is somehow essential for the use of the program, it would be far easier to simply remove these statements. An alternative, if you do require this screen control, could be using the curses or ncurses libraries. That requires interfacing with C routines, but at least the hard stuff, getting the terminal to properly listen to these codes, is no longer your responsibility ;).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 5A1 is a format for 5 single text characters ie up to 5 items of 1 character length.
The Fortran is none standard , printing 50 is printing Achar(50) (acsii 50) ie "2" achar(74) is "J"
155 is a non printing character. These are "escape sequences" uses by old terminals to do operations like clear screen.
See https://en.wikipedia.org/wiki/ANSI_escape_code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there an up-to-date equivalent for a modern terminal (e.g., PuTTY connecting to a RHEL 7 server), or is my best bet to just remove these lines that no longer do what was originally intended?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows has now returned some elements of the ASCII control characters to the console. I am sure on this forum there are some recent posts on this matter, here is the code from the earlier posts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unless the screen control is somehow essential for the use of the program, it would be far easier to simply remove these statements. An alternative, if you do require this screen control, could be using the curses or ncurses libraries. That requires interfacing with C routines, but at least the hard stuff, getting the terminal to properly listen to these codes, is no longer your responsibility ;).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can try using 7-bit ANSI escape sequence codes instead of 8-bit codes. For instance, instead of the 8-bit character 0x9B (155), you can use the two 7-bit characters, 'Esc', i.e., 0x1B, and '[', as the CSI (see the WIkipedia article for details).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Arjen_Markus is correct, using these codes is a complete nightmare and makes the coding really difficult to follow, but in 1988 it was the only choice, now you have much better choices.

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