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