[fpc-pascal]Two bugs in Win32 CRT unit
pasco at acm.org
Sat Mar 2 10:02:55 CET 2002
I am using the latest released version from http://www.freepascal.org/
version 1.04 to port some Borland Pascal for DOS programs to Win32
console apps. I have noticed two annoying bugs in the CRT unit:
(1) ClrEOL does not respect TextBackground
In the Borland Pascal for DOS version, ClrEOL sets the background
color of an entire line according to the most recent TextBackground
call. However, in Free Pascal for Win 32, it sets the background
color to black, regardless. Here is a sample program:
This should produce a full-width cyan line, with the letters "hi"
occupying the first two spaces. Indeed, in Borland Pascal it does.
However in Free Pascal, the only the "hi" have the cyan background.
(2) Keystrokes not registered until upstroke
Not only does this give the user poor visual feedback, it also has the
by-product that typematic doesn't work. Try holding down the "x" key
while running this program, first compiled in BP for DOS, then in FP
WriteLn('Type a few words. Hit Enter to quit:');
k := ReadKey;
if k=#0 then Readkey (* discard second half of function keys *)
else write(K) (* but echo ASCII to screen *)
until k=#$0D; (* terminate with ENTER key *)
My compliler switches include -Sgico for what it's worth.
More information about the fpc-pascal