Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!gatech!ncsuvx!shumv1!unkydave From: unkydave@shumv1.uucp (David Bank) Newsgroups: comp.lang.pascal Subject: Re: Clearing the keyboard buffer Summary: Not too hard Keywords: Clear keyboard Message-ID: <4113@ncsuvx.ncsu.edu> Date: 5 Oct 89 02:47:50 GMT References: <1169@krafla.rhi.hi.is> Reply-To: unkydave@shumv1.ncsu.edu (David Bank) Organization: NCSU Computing Center Lines: 29 In article <1169@krafla.rhi.hi.is> karlth@rhi.hi.is (Karl Thoroddsen) writes: >While writing in TURBO 4.0 I've constantly encountered the problem >of not being able to flush(clear) the keyboard buffer. > >Is there anyone out there who can help me? > >Thanks in advance > >Karl Thoroddsen I have a routine in TP 3.0 that does that. It goes.... WHILE KeyPressed DO read(kbd, dummy); Where "dummy" is a character and "KeyPressed" is the TP 3.0 function that checks to see if the keyboard buffer holds any characters. Even tho I have TP 4.0, I haven't bothered to convert this yet. I think "KeyPressed" was renamed in TP 4.0 and you use "readkey" instead of "read(kbd)". Don't have all the details, but that should do the trick. Hope it helps..... (Another wonderful device from Unky Dave's bag of software tricks! :-) Dave