Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-11

GoToXY, Clrscr, Clreol, Write, and Writeln Cause Bad Side Affects

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

David Finkelstein

Since nobody responded to my entry "Distracting Scan Lines or Slow Display in Full Screen Mode" that I posted on November 11th, let me put it a different and very blunt way:

GoToXY, Clrscr, Clreol, Write, and Writeln that worked fine in Turbo Pascal, just doesn't work properly in Free Pascal. I successfully ported a large Turbo Pascal application to Free Pascal. Everything works great EXCEPT for the User Interface.

The User Interface is based on a 25 X 80 window. The application runs on Windows 98, Windows XP and Windows Vista clients. On all clients, the User Interface is horrible.

Full screen mode is not supported for DOS bat file windows under Vista unless you reinstall the video driver and fake out Vista by installing the driver in XP compatibility mode. I successfully did this on 2 Vista clients that are running on computers made by different manufacturers. The bat file windows in full screen mode run fine EXCEPT for the Free Pascal application.

The Windows 98 and Windows XP clients can run in a small window or full screen. The Free Pascal application functions differently based on the size of the window... in that the output to the monitor is absolutley horrible.

On Windows 98, XP and Vista clients:

1. The screen randomly clears for 1 to 2 seconds, then redisplays its contents. When the screen clears, I think I hear a clicking noise.

2. The screen randomly blinks for a fraction of a second. That is, the screen goes dark, then redisplays its contents. No clicking noise is heard.

3. Random horizontal lines appear and disappear on the screen as Clreol's and Write's are performed.

Question 1:

Of all the thousands of Free Pascal applications running, hasn't anyone seen this? Or do the laws of physics act diffently on the 8 client computers that are running my application?

Question 2:

Since GoToXY, Clrscr, Clreol, Write, and Writeln cause bad side affects, what functions should I use to create a full screen 80 X 25 window, position the cursor, clear the window, clear to end of line, change the cursor size, turn the cursor on and off, and display text?

David

Reply by email

Michael Van Canneyt
to David Finkelstein
David Finkelstein wrote 21 lines
Since nobody responded to my entry "Distracting Scan Lines or Slow Display in Full Screen Mode" that I posted on November 11th, let me put it a different and very blunt way: GoToXY, Clrscr, Clreol, Write, and Writeln that worked fine in Turbo Pascal, just doesn't work properly in Free Pascal. I successfully ported a large Turbo Pascal application to Free Pascal. Everything works great EXCEPT for the User Interface. The User Interface is based on a 25 X 80 window. The application runs on Windows 98, Windows XP and Windows Vista clients. On all clients, the User Interface is horrible. Full screen mode is not supported for DOS bat file windows under Vista unless you reinstall the video driver and fake out Vista by installing the driver in XP compatibility mode. I successfully did this on 2 Vista clients that are running on computers made by different manufacturers. The bat file windows in full screen mode run fine EXCEPT for the Free Pascal application. The Windows 98 and Windows XP clients can run in a small window or full screen. The Free Pascal application functions differently based on the size of the window... in that the output to the monitor is absolutley horrible. On Windows 98, XP and Vista clients: 1. The screen randomly clears for 1 to 2 seconds, then redisplays its contents. When the screen clears, I think I hear a clicking noise. 2. The screen randomly blinks for a fraction of a second. That is, the screen goes dark, then redisplays its contents. No clicking noise is heard. 3. Random horizontal lines appear and disappear on the screen as Clreol's and Write's are performed. Question 1: Of all the thousands of Free Pascal applications running, hasn't anyone seen this? Or do the laws of physics act diffently on the 8 client computers that are running my application?

Nobody uses CRT any more.

Question 2: Since GoToXY, Clrscr, Clreol, Write, and Writeln cause bad side affects, what functions should I use to create a full screen 80 X 25 window, position the cursor, clear the window, clear to end of line, change the cursor size, turn the cursor on and off, and display text?

You can use the screen/keyboard/mouse units for this. The text-mode IDE uses that.

But the best thing is to write a GUI application; You can use lazarus for this.

You can perfectly mix TP and Delphi mode units.

Michael.

Reply by email

Daniël Mantione
to David Finkelstein: Since nobody responded to my entry "Distracting Scan Lines or Slow Display in Full Screen…

Op Tue, 25 Nov 2008, schreef David Finkelstein:

Show quoted text 5 lines
Since nobody responded to my entry "Distracting Scan Lines or Slow Display in Full Screen Mode" that I posted on November 11th, let me put it a different and very blunt way: GoToXY, Clrscr, Clreol, Write, and Writeln that worked fine in Turbo Pascal, just doesn't work properly in Free Pascal.  I successfully ported a large Turbo Pascal application to Free Pascal.  Everything works great EXCEPT for the User Interface.

Does the Free Pascal IDE run correctly on the systems you are experiencing problems with? If yes, the problem is with your program. If no, it must be the system you are working on.

Your program may be using the CRT unit too heavily, i.e. many programs using CRT call "write" for each character, or move the cursor for each character. This may work fine on Dos, but on modern operating systems the text mode is often emulated. Further, our crt unit has to emulate the braindead old crt API on the Windows text mode API.

Show quoted text 6 lines
Question 2: Since GoToXY, Clrscr, Clreol, Write, and Writeln cause bad side affects, what functions should I use to create a full screen 80 X 25 window, position the cursor, clear the window, clear to end of line, change the cursor size, turn the cursor on and off, and display text?

Well, the video unit is the recommended API for cross platform text mode interfaces.

Daniël

Reply by email