russ@hpldola.HP.COM (Russell Johnston) (04/26/88)
Is there a procedure/function in Turbo Pascal 3.0 to read a character displayed at a specific location on the screen?
rbw@WILLIAMS.EDU (05/02/88)
There isn't one standard, but I have one. If you (or anyone else) wants it, I will send/post it. -Richard Ward rbw@cs.williams.edu Williams College, Williamstown, MA
taylorj@byuvax.bitnet (05/03/88)
There's nothing built into Turbo to read a character from the screen, but
if you're using a true blue IBM or anything compatible on the BIOS level
(99% of all clones are), try the following:
{Reads character and attribute from screen using BIOS}
procedure getxy(x, y :byte; var ch, atr :byte);
var
reg :regpack;
begin
gotoxy(x,y);
reg.ah := $08;
reg.bx := 0;
intr($10,reg);
ch := reg.al;
atr := reg.ah;
end;
Where "regpack" is
type
regpack = record case integer of
1: (ax,bx,cx,dx,bp,si,di,ds,es,flags : integer);
2: (al,ah,bl,bh,cl,ch,dl,dh : byte)
end;
Jim Taylor
Microcomputer Support for Curriculum, Brigham Young University
taylorj@byuvax.bitnet