home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / config_server / doc / set_raw.doc < prev   
Text File  |  1995-02-12  |  3KB  |  71 lines

  1. set_raw makes a CON: window act like a RAW: window.
  2.  
  3. This is useful for DOS, and especially ARexx, scripts.  If you want to be
  4. keystroke interactive with a program, running set_raw as part of the
  5. program, or before running the program, will achieve this.  Generally, you
  6. will want to do this only INSIDE a program.  However, an example use of
  7. this _outside_ of some desired program is with the old game, Conquest:
  8.  
  9.     Conquest is a stellar game of conquering planets and beating the
  10.     computer's empire with your empire.
  11.  
  12.     Conquest (at least the version I had) normally opens its own little
  13.     RAW: window.  You must click on the RAW: window to make it active in
  14.     order to talk to the Conquest game (well, initially, the Conquest RAW:
  15.     window is active, but if you click on something else, you need to
  16.     return to the Conquest's RAW: window to resume talking to the game.)
  17.     This isn't very friendly...
  18.  
  19.     I patched my copy of the Conquest game to open "*" rather than a
  20.     "RAW:...".  This makes it use the current Shell window.  But, the Shell
  21.     window is NORMALLY line-buffered, rather than keystroke-interactive.
  22.  
  23.     Well, I then wrote a script that ran my patched copy of Conquest, like
  24.     so:
  25.  
  26.         set_raw     ;; Turn Shell to RAW: behavior
  27.         conquest    ;; Run patched Conquest in current shell
  28.         set_con     ;; Return Shell to CON: behavior
  29.  
  30.     This was nicer for playing in a Shell, and makes it a feasible "door
  31.     game" to run under a BBS, etc.
  32.  
  33.  
  34.     Also, as I recall, XLisp expected keystroke-interactive input, but the
  35.     port I dealt with didn't "know" how to do that with the CON: window.
  36.     By running set_raw before starting XLisp, I was able to get XLisp to
  37.     behave more like it should.
  38.  
  39.  
  40.     I find this extremely handy for occasional ARexx scripts that need to
  41.     read a Shell console without waiting for the user to press <Return>.
  42.  
  43.  
  44.     NOTE that when in RAW: mode, _all_ line-editing that the CON: window
  45.     provides is LOST.  Back-space, delete, left/right/up/down arrows, etc.,
  46.     are all gone.
  47.  
  48.  
  49. set_raw/set_con are REQUIRED by config-editor.  Put them in your path
  50. somewhere.
  51.  
  52.  
  53. Do NOT leave a Shell window in "set_raw" (RAW:) mode.  Doing so makes the
  54. shell difficult to use (not impossible, but difficult).  If you ever find
  55. that a Shell window "just sits there" when you type at it (no text echoed
  56. to your screen, etc.), it may be in "RAW:" mode.  To fix it, try this:
  57.  
  58.     type a control-J (^J, <Ctrl>-<J>, however you wanna describe
  59.     it...*grin*).
  60.  
  61.     Type the word "set_con" (if you make ANY typos, type ^J and start over;
  62.     do NOT attempt to "edit" with the backspace, as "editing" won't do any
  63.     good).
  64.  
  65.     Type another ^J after you think you correctly typed "set_con".
  66.  
  67. If you did it correctly, if set_con was on your command search path, and if
  68. the problem really was that your Shell was left in RAW: mode, this should
  69. fix it.
  70.  
  71.