Category : Files from Magazines
Archive   : APR91.ZIP
Filename : 2N04058A

 
Output of file : 2N04058A contained in archive : APR91.ZIP
{ RdKey to replace Turbo Pascal's ReadKey with a
function that (1) doesn't require clearing before
reuse after a call that yields ch = #0 and (2)
differentiates pairs such as BackSpace and Ctrl-h.

Implemented in Pascal
}
interface

type
KeyRec = record
ch : char;
sc : byte;
end;

function RdKey(var Grabber : KeyRec) : Char;

implementation

function RdKey{(var Grabber : KeyRec) : Char};

var
regs : registers;

begin
regs.ah := 0;
intr($16,regs);
if regs.al <> 0 then { ascii <> 0 }
with grabber do
begin
ch := char(regs.al);
sc := regs.ah;
RdKey := ch
end
else { ascii = 0 }
with grabber do
begin
ch := char(regs.ah);
sc := 0;
RdKey := Char(regs.al);
end;
end;



  3 Responses to “Category : Files from Magazines
Archive   : APR91.ZIP
Filename : 2N04058A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/