[comp.sys.amiga] Amiga console -- reading from it

rwilson@uvicctr.UVic.ca.UUCP (rwilson) (10/15/89)

Help! I'm a new Amiga programmer.  I'm rushing to write a complicated graphics
program, and I'm trying to do things as simply as possible.  What I am trying
to do is open a screen, open a new window, use OpenDevice to open the console,
and read and write stuff via the console.  (I'm doing it this way instead of
using the CLI because I also want to use menus and do graphics.)
 
I have reached the stage where I can open everything, write via the console,
and close everything.  (That was hard enough.)  However, when I try to read
from the console, what I type does not appear on the screen and a moment later
I get a Guru meditation (I think #00000003.something) and then a reboot. 
I am opening the console with an IOStdReq structure, like this:

struct IOStdReq *IOReq;

.....

OpenDevice ("console.device", 0, IOReq, 0);

and I am reading (or trying to) by:

char buffer[];
int  bufsize;

.....

IOReq->io_Data    = (APTR) buffer;
IOReq->io_Length  = (ULONG) bufsize;
IOReq->io_Command = CMD_READ;
DoIO (IOReq);

This is the way the Intuition book described (briefly), but as I said it
isn't working.  Does anyone know what's wrong?

I'm new to this network, and there may have been a dozen messages just like
this posted and answered already.  If so, I apologize for the repetition,
but I would really appreciate any help you can give me.

                             -- Mia

Note: this is not my account, but if you send a response or email to
rwilson@uvicctr.uvic.ca  I will get it.