[fpc-pascal]Reading the screen under win32

Martin Hankovec Martin.Hankovec at oku-st.cz
Mon Oct 2 08:14:18 CEST 2000


Hello,
daworm wrote:
>>This is code snagged from a console mode windowing unit I did last year in Delphi.  It should be failry easy to make work in FPC.  There is a lot of crap you won't need, but it is complete enough that you should be able to pop it into a test program and run it.
<<

I have put it into simple program:
.........
uses Windows, Crt;

....Your code of procedures is here ....

{--- MY MAIN PROGRAM  -----------}
begin
 win_minX:=1;			{coordinates of whole screen}
 win_minY:=1;
 win_maxX:=80;
 win_maxY:=25;

 clrscr;
 gotoxy(10,10);
 writeln('Hi, how are You ?');		{write it at coord. 10,10}
 win_push;				{save it to buffer}
 readln;					{wait for ENTER}
 gotoxy(10,10);
 writeln('Good morning once again.');	{write another message at coord. 10,10}
 readln;					{wait for ENTER}
 win_pull;				{restore screen - it should be message 1}
 readln;					{wait for ENTER}
end.
{ ------ END OF PROGRAM --------}

Please, where is the bug in my program ? It doesn't work. It writes message 1 ("Hi, how are You ?"), waits for ENTER. Then the program writes over it message 2 ("Good morning once again."). It's right. And then, after pressing ENTER, it should restore the message 1. But nothing happens!

Thanks for help

Martin





More information about the fpc-pascal mailing list