home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!ukma!wupost!usc!elroy.jpl.nasa.gov!jato!jdickson
- From: jdickson@jato.jpl.nasa.gov (Jeff Dickson)
- Subject: Re: A couple of questions
- Message-ID: <1992Nov16.222301.21722@jato.jpl.nasa.gov>
- Organization: Jet Propulsion Laboratory
- References: <55989@dime.cs.umass.edu> <1992Nov13.063457.22216@ucc.su.OZ.AU> <56246@dime.cs.umass.edu>
- Date: Mon, 16 Nov 1992 22:23:01 GMT
- Lines: 53
-
- In article <56246@dime.cs.umass.edu> robinson@elux2.cs.umass.edu (RICHARD ROBINSON) writes:
- >
- >In article <1992Nov13.063457.22216@ucc.su.OZ.AU> willw@extro.ucc.su.OZ.AU (William Waring) writes:
- >>In article <55989@dime.cs.umass.edu> robinson@elux3.cs.umass.edu (RICHARD ROBINSON) writes:
- >>>>>
- >>>Ok, I have a couple of questions that I'd love to find answers to.
- >>>
- >>>1. Can a packet sent to DOS be aborted? I send an ACTION_READ to a console,
- >>>and need to get rid of it when I exit. I just can't ask the user 'please hit
- >>>a key so I can exit.' And since the exit is based on the termination of
- >>>another process, there is no way to not send the packet when I'm about to,
- >>>'cause I don't know when it is going to exit.
- >>>
- >>>Failing that, can I trick the console into thinking I typed something?
- >>
- >>Are you using the console.device or opening a "CON:" window. If you're
- >>using CON: and Wb2.0, then you don't have to send a ACTION_READ packet to
- >>the device. Just do a straight SetMode(FileHandle,1) to turn the console
- >>window into RAW: mode. Then just do a straight DOS
- >>Read(FileHandle,DummyChar,1) from the filehandle. You should probably set
- >>the mode back to CON: when you do that. Other than that, shouldn't have
- >>any problems... If you're doing it using the console.device then look in
- >>the RKM: Devices manual for information on how to program the device. It's
- >>too lengthy to explain here... But I don't think you're using that meathod?
- >
- >Well, I am running under 2.0, but with 1.3 includes (poor college student),
- >so 2.0 functions that can be called without 2.0 includes are the limit.
- >
- >Anyway, ACTION_READ, not ACTION_SCREEN_MODE... I am doing asynchronous
- >reads by sending a ACTION_READ packet. Read(filehandle,buffer,x) would freeze
- >me up. It has nothing to do with the mode of the console.
-
- Oh, yes it does! If the console is not operating under RAW mode, then reads
- will block until the number of chacters to read (in this case 'x') has been
- read.
-
- >I send a READ,
- >and when it returns, stuff the character into a pipe. When I am ready
- >to exit, there is one outstanding read. I need to be able to kill it.
-
- Another way would be to generate the number of characters needed to satisfy
- the read request when your program wanted to exit. This could be done by
- using the IND_WRITEEVENT command of the Input device. This precludes that
- your program's window would be the one currently receiving input when the
- program decided to exit.
-
- >--
- >Dread (Richard Robinson, Univ of Mass, Amherst)
- >dread@titan.ucc.umass.edu "There is no right, there is only power!"
- >robinson@elux3.cs.umass.edu "Kill them, kill them all!"
-
- Jeff
-
-