home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / apple2 / 20092 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.9 KB  |  52 lines

  1. Newsgroups: comp.sys.apple2
  2. Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!actrix!David.Empson
  3. From: David.Empson@bbs.actrix.gen.nz
  4. Subject: Re: Keypress function in pascal?
  5. Organization: Actrix Information Exchange
  6. Date: Thu, 10 Sep 1992 13:32:30 GMT
  7. Message-ID: <1992Sep10.133230.28985@actrix.gen.nz>
  8. References: <1992Sep5.170740.54265@qut.edu.au>
  9. Sender: David.Empson@actrix.gen.nz (David Empson)
  10. Lines: 40
  11.  
  12. In article <1992Sep5.170740.54265@qut.edu.au> hollandd@qut.edu.au writes:
  13. > I need some help with a simple programming problem..
  14. > The situation is that I have to do a particular project in pascal,
  15. > and since I normally use my nice new version of ORCA C, my copy of
  16. > ORCA Pascal is now rather out of date.. 
  17. > But to the point.  Does there exist in Orca pascal a function that
  18. > will return a keypress without waiting for return to be pressed?
  19. > Not as far as I can tell from the manual?
  20.  
  21. I don't program in ORCA/Pascal very often, and I'm not aware of any
  22. such function.  If you have the ORCA/M assembler, you could write a
  23. keypress function in assembly language, and link it to your
  24. ORCA/Pascal program.
  25.  
  26. You could also use the Text Toolset to check for a pending byte on
  27. standard input.  I'm not sure which toolbox USES files you'll require.
  28.  
  29.   StatusTextDev(0, 1);    { 0: INPUT device, 1: 'is input ready?' }
  30.   If ToolError Then
  31.     { No input is available }
  32.   Else
  33.     { Input is available }
  34.  
  35. Caveat: I haven't tried this.  I always use my assembly language
  36. IsKeypress function.
  37.  
  38. I can't remember if ORCA version 1.x uses the Pascal or BASIC 80-column
  39. firmware (the BASIC firware doesn't support this call).  ORCA 2.0 uses
  40. the GS/OS console driver, and should be able to handle this call.
  41.  
  42. Unfortunately the ORCA shell doesn't provide a 'read console' call,
  43. only 'write console'.
  44. -- 
  45. David Empson
  46.  
  47. Internet: David.Empson@bbs.actrix.gen.nz    EMPSON_D@kosmos.wcc.govt.nz
  48. Snail mail: P.O. Box 27-103, Wellington, New Zealand
  49.