Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!umich!sharkey!tygra!dave From: dave@tygra.ddmi.com (David Conrad) Newsgroups: comp.lang.pascal Subject: Re: Preset KeyPressed Function? Message-ID: <536@tygra.ddmi.com> Date: 26 Nov 90 06:23:56 GMT References: <9011251958.AA08961@euler.Berkeley.EDU> <1728@umriscc.isc.umr.edu> Reply-To: dave@tygra.UUCP (David Conrad) Organization: CAT-TALK Conferencing Network, Detroit, MI Lines: 30 In article <1728@umriscc.isc.umr.edu> mcastle@mcs213a.cs.umr.edu (Mike Castle) writes: > >I was using a repeat until keypressed routine at the ends of some >[...] >Unfortunately, that doesn't clear the keyboard buffer. Any subsequent >keypressed call returned true. Also, readkey would return that keystroke >immediately. > >I've since gone to using ch:=readkey when ch is type ch and not used for >anything else. > It can also be done without wasting an otherwise unused variable: ... repeat ... until keypressed; if readkey = #0 then if readkey = #0 then; ... This method tosses out the second code returned by those keys which return two codes (such as F1 and PgDn), an advantage over the above method. Hope this helps. -- David R. Conrad | The goal of Artificial Intelligence is to build dave@tygra.ddmi.com | computers which act like the ones in the movies. -- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive = - 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") = E-MAIL Address: dave@DDMI.COM