[fpc-pascal]Reading the screen

Martin Hankovec Martin.Hankovec at oku-st.cz
Fri Sep 29 07:09:04 CEST 2000


Hi,
I think, here is a solution for text console under DOS:
.....
uses go32v2....
....
{reads ascii value and attribut from text console}
{x,y - coordinates, returns ascii and attribut of char on position x,y}

procedure getscreenchar(x,y:integer;var ascii:char;var attribut:byte);
var
  segment,offset:word;
begin
    segment:=$a7f7+(10*y)+(x div 8);	{address of char}
    offset:=$ffee+((x mod 8)*2);
    dosmemget(segment,offset,ascii,1);	{read ascii}
    inc(offset);
    dosmemget(segment,offset,attribut,1);	{read attribut}
end;

Have a good day
Martin H.





More information about the fpc-pascal mailing list