[comp.sys.amiga] How do I read a character using Modula II?

d87-khd@sm.luth.se (Karl-Gunnar Hultland) (01/08/89)

I've tried to write a routine in Benchmark Modula which would
allow me to wait for the user to press one character and then
return a char containing the key pressed.

But...

I've failed using the internal functions listed below

Module      Function       Error

Terminal
InOut       Read           Don't start to process until the user
                           type RETURN.

TermInOut   Read           A visit from the guru.

CStdIO      getchar        just returns -1 what ever I do.

And as I've used all the options found in the modules
(except opening the console as a file and do AmigaDOS Read )
I decided to post this article hoping someone out there has
the answer to my problem.


<$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$>
< Karl 'Kalle' Hultland    <$> d87-khd@luth.UUCP |                           >
< Dept. of Comp. sci.      <$> d87-khd@tau.luth.se |                         >
< University of Lulea      <$> {uunet,mcvax}!enea!tau.luth.se!d87-khd        >
< Sweden                   <$>                                               >
<$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$>
<      If two people agree on EVERYTHING , one of them is OBSOLETE!!         >
<$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$><$>

cs161agc@sdcc10.ucsd.EDU (John Schultz) (01/14/89)

In article <508@tau.luth.se> Karl-Gunnar Hultland <d87-khd@tausm.luth.se> writes:
>I've tried to write a routine in Benchmark Modula which would
>allow me to wait for the user to press one character and then
>return a char containing the key pressed.


  You can use BusyRead from Terminal.  You can also open a
window (from SimpleWindows) and use the console device. 
I haven't tried it, but you could open "*" as a file and use
OpenInputFile, or even open a "CON://640/200" (that would probably
be best).


 John Schultz