Am Wednesday, dem 14. Sep 2005 schrieb Prof A Olowofoyeku (The African Chief):
Programs using the CRT unit do compile and the output stuff is all okay, but the input doesn't work as it should.
On most keypresses ReadKey just returns #0+#255, just occasionly it returns the correct keycode.
ReadLn also behaves strange: It takes and displays the entered text correctly, but when I press the Enter-key, it just displays a musical note (the character of #13). When I repeat typing the Enter key, then at some point it is accepted. But the input string still has all the other #13's at its end.
BTW. the same happens with the Backspace key...
Can you please send a test program? I have not encountered any of these problems.
On my system it happens with any simple program which uses CRT.
Program readtest; uses CRT;
var s: String(80);
begin CRTInit; ReadLn(s); WriteLn(s) end.
Program keytest; uses CRT;
var c: char;
begin CrtInit; repeat c := ReadKey; WriteLn(c:2, ord(c):4); until false; end.
Also, what is your GPC version? (run "gpc -v").
Reading specs from c:\progra~1\mingw\bin..\lib\gcc-lib\mingw32\3.2.3\specs Configured with: ../configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=pascal --disable-win32-registry --disable-shared --enable-sjlj-exceptions --without-x --enable-interpreter --enable-hash-synchronization Thread model: win32 gpc version 20041218, based on gcc-3.2.3 (mingw special 20030504-1)
It's the binary from your website.
Is GPC for MSYS better?
Better in what way?
I mean, why should I prefer one over the other? I'm using the mingw compilers with the MSYS environment.
I've seen, that GPC still doesn't support "{$AppType GUI}" or "{$AppType Console}". That's an extension comming from Delphi. Free Pascal supports it on the Windows and the Amiga platform. I found out, that in GPC they correspond to the linker-parameters "-mwindows" or "-mconsole". But it would be nicer to have it in the source code.
And then the source code would not be portable. Those switches may well mean nothing under anything other than Windows.
Okay, that's a point. But I'm using lots of {$IfDef _Win32} anyway.