eric_carwardine Posted April 4, 2010 Report Share Posted April 4, 2010 G'day, folks:D I've been coaxed out of retirement to "modernise" some Fortran programs I wrote last milennium; namely Fortran main program calling C/C++ functions. The modernising was accomplished, using Silverfrost's FTN95 suite. Problem is, when the compiled .exe file was run in the DOS ( command.com ) window the screen-formatting sequences are being ignored. These sequences are used to accomplish things like screen clearing and cursor positioning and are driven via ansi.sysI've checked that command.com is initialising via autoexec.nt and config.nt where the only active part of config.nt is as follows:device=%SystemRoot%\System32\ansi.sysdevice=%SystemRoot%\system32\himem.sysfiles=40dos=high, umbTo simplify the problem of getting ansi.sys to do the right thing I wrote a short test program in Fortran. It is meant to clear the screen by emitting the four-character sequence <esc>[2J where <esc> is the ASCII character decimal 27. All that happened (appeared on the screen) was a left-pointing arrow (presumably to represent the escape character) followed by '[2J'. The Fortran code appears below, and I've placed the .exe file at http://www.kurrattan.net/exhibits/testesc.exe character esc*1C esc = char(27)C pause'All this text should be cleared when enter ''go''.' write(*,21) esc21 format(1x,a1,'[2J') pause'Screen should be clear.' stop endAny suggestions that will get ansi.sys to do the right thing will be gratefully implemented. I presume that my ansi.sys is up to the job; it came with my Windows XP Home edition.Eric Carwardine, in Perth, Western Australia Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted April 5, 2010 Report Share Posted April 5, 2010 Welcome to the Windows Forum.I don't know if we have anyone here who knows (or remembers) these low-level screen formatting commands. I certainly don't (I have done low-level screen formatting on IBM 3270 devices on VTAM level, but never on DOS).But I have read up a bit on it (http://en.wikipedia.org/wiki/ANSI.SYS, http://en.wikipedia.org/wiki/ANSI_escape_sequence), and from a first glance you seem to be doing the right thing. (Although I am not sure if splitting the CSI into two output commands is actually correct.)Hopefully someone with more practical experience will comment on your post. I am moving this topic to the Programming section, where it may stand out a bit better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.