home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / programm / 15932 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.0 KB  |  64 lines

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