Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!zephyr.ens.tek.com!vice!bobb From: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Newsgroups: comp.lang.pascal Subject: Re: procession towards keypressed continues Message-ID: <7451@vice.ICO.TEK.COM> Date: 14 May 91 23:33:33 GMT References: <1991May14.151208.11501@javelin.sim.es.com> Reply-To: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Organization: Tektronix, Inc., Beaverton, OR. Lines: 59 In article <1991May14.151208.11501@javelin.sim.es.com> tpehrson@javelin.sim.es.com writes: >i finally got my kepressed function, as follows: > > function keypressed:boolean; > var regs:registers; > begin > with regs do begin > ah:=$00; keypressed:=(FZero and flags)=$00; > end; > end; > >and my code looks something like: > >... > while not keypressed do begin > otherstuff; morestuff; end; > case upcase(readkey) of >... > >and now my gripes: > >1. otherstuff et al is never being reached. i suppose i have some initializ- > ation that needs doing. what and how? > >2. once 1 is resolved, a second key will be required at the (readkey), correct? > i would like to know an efficient way around this (use the key that was > pressed to bypass not keypressed). > This is going to sound pompous but oh well, it's been that kind of day... Since you've been posting this question repeatedly for a week now, it seems that we need to resolve the problem. First, look at your code as posted above. From what I can see, you either don't have documentation for the copy of Turbo you're trying to use, or you don't know how to glean information from said documentation. You're code fragment sets a variable (regs.ah) to 0. The next line is where you're checking for a keypress. How exactly do you think that the two actions are related? You're "otherstuff" section of code doesn't get called because you're not even close to having a replacement for keypressed. You need to do one of two things: download a canned solution (like offered at garbo or simtel) to your problem, or learn a whole lot more about the maching you're programming on before you try a low level interface routine. That's why high level languages were invented in the first place. [ off pulpit] /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Bob Beauchaine bobb@vice.ICO.TEK.COM C: The language that combines the power of assembly language with the flexibility of assembly language. "It seems that the less a statesman amounts to, the more he appears to love the flag".