[fpc-devel] GoToXY, Clrscr, Clreol, Write, and Writeln Cause Bad Side Affects

Daniël Mantione daniel.mantione at freepascal.org
Tue Nov 25 12:24:38 CET 2008



Op Tue, 25 Nov 2008, schreef 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.

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.

> 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


More information about the fpc-devel mailing list