Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!herald.usask.ca!news From: reeves@dvinci (Malcolm Reeves) Newsgroups: comp.lang.pascal Subject: Re: How Can I empty COM1 port in TP? Message-ID: <1990Sep4.050722.29241@herald.usask.ca> Date: 4 Sep 90 05:07:22 GMT References: <34499@unix.cis.pitt.edu> Sender: news@herald.usask.ca (USENET News System) Reply-To: reeves@dvinci Organization: University of Saskatchewan Lines: 12 From article <34499@unix.cis.pitt.edu>, by cncst@unix.cis.pitt.edu (Christophe N. Christoff): > > The title says it all. How can I empty COM1 port in TP? > How can I tell how many characters are there in COM1? Read them one at a time until there are none. This isn't meant to be a facetious reply - to answer your question I need to know how you are reading from COM1. You should have a buffer somewhere with a pointer to tell you how full it is. I flush the COM buffer by setting the pointer to position zero but there are lot's of ways to write a serial port handler. There's a PD unit called Asynch I think which does a reasonable job. Hope this is of some use.