home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8578 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!utcsri!bonnie.concordia.ca!hobbit.ireq.hydro.qc.ca!beaurega
  2. From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Summary: How to flush keyboard buffer
  5. Message-ID: <Bt54q3.8oJ@ireq.hydro.qc.ca>
  6. Date: 17 Aug 92 18:30:03 GMT
  7. References: <1992Aug14.014304.27238@news.ysu.edu>
  8. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  9. Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada
  10. Lines: 28
  11.  
  12. One comment I have regarding this trend.
  13.  
  14. What happens if you depress ctrl-break and your program is enough over
  15. DOS not to stop at that moment (i.e. if you disabled ctrl-break by
  16. something like signal() or other mean).
  17.  
  18. In one case (kbhit?), the value returned is either 0 or the character
  19. received.  But ctrl-break is also returning a value of 0!
  20. In other words, the program will freeze or exit if you typed ctrl-break!
  21.  
  22. My work-around consisted in writing my own kbhit function in Assembler.
  23. I called it keyin().
  24.  
  25. Instead of returning the character received, it tests the zero flag and
  26. return a response accordingly (0 or 1 for instance).  I think both
  27. bioskey(1) and kbhit return the input character, so this must be
  28. checked.  Also, this particular behaviour (I consider this as a bug)
  29. was found in Zortech compiler.  No idea if Borland, Microsoft or
  30. other will do the same.
  31.  
  32. One last word : if you know how to process ctrl-break, you probably
  33. already have a work-around or set the BREAK switch so it does not harm.
  34.  
  35. -- 
  36.   \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
  37.  /   \   Genealogiste officiel : Beauregard/Jarret/Jarest/Vincent
  38. J   __>  Barthelemy Jarret (1471) -> Andre Jarret, sieur de Beauregard (1665)
  39. \_.-===   -> Denis Beauregard (1992)                  Opinions ? Et pis non !
  40.