[fpc-pascal]CRT unit (was: Beep in Windows)

Thomas Schatzl tom_at_work at yline.com
Tue Aug 7 18:31:16 CEST 2001

From: "Rich Pasco" <pasco at acm.org>
Subject: Re: [fpc-pascal]CRT unit (was: Beep in Windows)

> Thomas Schatzl wrote:
> > WindMax contains garbage on NT consoles because the height of the
> > window is > 255 lines by default. Since Borland only reserved a byte for
> > width and height inside this variable your app will have serious
> > with that.
> Umm, I thought that when a program using the CRT unit was active,
> the NT console buffer was out of the picture, and the CRT unit used


> the physical window size (which would be less than 255 lines to fit


> on the screen, unless a very tiny font were used on a very high-res
> display).

But it does have to be considered. You can reach that resolution with an 8x8
font 'already' at 2048x1536 which modern graphics cards already support (256
columns), e.g. ATI's Radeon graphics card series.
That's not the main problem. The problem is that the windmax variable just
represents the "screen dimensions" at a certain point in time, e.g. the
moment the crt unit is initializing. Three miliseconds after that event it
is not guaranteed to be true anymore. So it does not really matter whether
the variable contents were actually true at crt initialization time.
Even if they were updated by the crt unit, there's no way your TP program
gets to know that change (in the Borland CRT interface). You could poll
those vars, but this not only is a
waste of cpu resources it is also expected that your legacy TP app you want
to port simply does not take such changes into consideration during runtime.


More information about the fpc-pascal mailing list