Struggling with a strange on screen format issue

In summary, the program is old and needs to be updated to use modern screen controls. Modifying the program to do so may not be easy.
  • #1
NurseKaren
6
3
Hi,

I really hope someone here can help. I'm a nurse and not in the computer field (so I might be doing something dumb). We have a really old fortran system that we keep old history on. I'm trying to move the program onto a new computer. Its been a mission to do, but I've got through most issues on my own until I got to this one which I've been struggling with for a week.

The program starts up fine but seems to be showing strange characters before and after all messages on screen. A friend said they looks like 'carriage returns' to him.

See attached image.

Please help, thank you kindly in advance.
 

Attachments

  • fortran.png
    fortran.png
    1.3 KB · Views: 584
Technology news on Phys.org
  • #2
:welcome:

I'm not 100% sure, it has been a while. But those characters look like the codes used to control screen colors, cursor position, bold, italic and so forth on one of those old video terminals. Terminals like the DEC VT100. I'm guessing that the program was written to be specific for that terminal. To fix it, you'll have to modify the program to take away all the stuff that does not apply to modern screens. That may not be easy. Good luck.
 
  • Like
Likes Asymptotic, 256bits and Tom.G
  • #3
Okay interesting, thanks for the reply. The program is currently running on a really old Win XP machine and I'm trying to move it on Win7 running on a XP Virtual machine. I'm getting those characters on the new win7 machine.
 
  • #4
Welcome to the PF. :smile:

Do you have the source code? Or are you trying to do this with just an executable?
 
  • #5
berkeman said:
Welcome to the PF. :smile:

Do you have the source code? Or are you trying to do this with just an executable?
Just the executable. I can't code. Its really old not sure if the source code is still around.
 
  • #6
It's worth it to ask around. If we have the source code, that would help a lot.
 
  • #7
NurseKaren said:
Okay interesting, thanks for the reply. The program is currently running on a really old Win XP machine and I'm trying to move it on Win7 running on a XP Virtual machine. I'm getting those characters on the new win7 machine.
You are looking at Ainsi escape sequences.
The Ainsi command starts with the ESC character 27 dec ( 1Bhex ), which is showing up as the left arrow.
Then the bracket.
Then the characters that control the screen or keyboard.
https://www.computerhope.com/ansisys.htm

Is your program running in a compatibility mode on the old XP machine?
I would think your program is a DOS program ? Console.

You may have to check the old config.sys on XP - not sure of the file name, where the device Ainsi.sys is loaded.
Maybe someone else can help with the device driver loads for virtual systems.

Your new machine is probably running Win 7 64 bit.
That could complicate matters, just musing outloud.

Been a while also.
 
  • Like
Likes Asymptotic and berkeman
  • #8
Those are formatting sequences, they do things like color. Looks like they worked in an older DOS, but not in the Windows shell because it's not actually DOS. It might work in PowerShell or Cygwin, but the easiest solution would probably to run the program through a program called DOSBox, which you can download for free. I use DOSBox for old DOS games, which do not work on Windows at all.
 
  • Like
Likes Asymptotic
  • #9
The feature that is being discussed was removed at some point after XP and replaced in Windows 10. If you update to Windows 10, it should work.
 
  • Like
Likes Asymptotic
  • #10
Echoing what the others have said, you are looking at ANSI escape sequences hearkening back to the days of DEC video display terminals. The left arrow is what many DOS-based programs used to signify 'ESC' (ASCII code 27), and what comes after the left bracket are instructions to the display terminal on how to proceed.

For instance, from your example,
Code:
ESC[0;37;40m    
'm' suffix indicates this is a change in graphics mode
0; reset all attributes
37; set foreground color to white (foreground would be the text color in this case)
40; set background color to black
    Elsewhere, ";33:" sets foreground to yellow

ESC[2J
Erase display

ESC[06;30H
'H' suffix indicates where to place the cursor
Move cursor to line 6, column 30

ESC[K
erase line (this is what clears the password line after the password has been entered)

What operating system are you using?

I've never had the need, but get someone from your IT department involved, and find out whether Jason Hood's ANSICON utility does the trick.
 
  • Like
Likes berkeman
  • #11
Wow, such amazing answers. So helpful, thank you so much. You folk are incredible. *hug*!

Will try some next week and see how I go.
 
  • Like
Likes berkeman
  • #12
Hi again,

After a few hours struggling and lots of reboots it's finally working yay!

I added the device ansi.sys to the config.nt file and my problem disappeared.

Article how to do it in case anyone else has the problem: https://support.microsoft.com/en-au/help/101875/how-to-enable-ansi-sys-in-a-command-window

Thank you so much for your help, I wouldn't of solved this without you. Thank you!
 
  • Like
Likes Asymptotic and berkeman
  • #13
NurseKaren said:
After a few hours struggling and lots of reboots it's finally working yay!
And after only a week! Are you sure you don't want a job as a Programmer?:wink:
 
  • #14
HAHA! Thanks but no thanks! (but thanks for the kind words :)
 

1. What could be causing the strange on screen format issue?

The issue could be caused by a variety of factors including coding errors, browser compatibility issues, or conflicts with other software.

2. How can I troubleshoot the strange on screen format issue?

Start by checking for any coding errors or conflicts with other software. You can also try clearing your browser's cache and cookies, or using a different browser to see if the issue persists.

3. Can the strange on screen format issue be fixed?

Yes, in most cases the issue can be resolved by identifying and addressing the underlying cause. However, if the issue is due to a bug or limitation in the software, it may not be easily fixable.

4. Will fixing the strange on screen format issue affect my website's functionality?

It depends on the cause of the issue and how it is fixed. It is always a good idea to test any changes on a development or staging site before implementing them on your live website.

5. What should I do if I am unable to fix the strange on screen format issue?

If you are unable to fix the issue on your own, you can reach out to a web developer or technical support for assistance. They may be able to identify and resolve the issue for you.

Similar threads

  • Introductory Physics Homework Help
Replies
2
Views
177
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
32
Views
3K
  • Programming and Computer Science
Replies
3
Views
1K
Replies
1
Views
1K
Replies
40
Views
2K
  • STEM Academic Advising
Replies
7
Views
861
  • Science Fiction and Fantasy Media
Replies
34
Views
3K
Replies
2
Views
881
Back
Top