home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
bazy
/
config_server
/
doc
/
set_raw.doc
< prev
Wrap
Text File
|
1995-02-12
|
3KB
|
71 lines
set_raw makes a CON: window act like a RAW: window.
This is useful for DOS, and especially ARexx, scripts. If you want to be
keystroke interactive with a program, running set_raw as part of the
program, or before running the program, will achieve this. Generally, you
will want to do this only INSIDE a program. However, an example use of
this _outside_ of some desired program is with the old game, Conquest:
Conquest is a stellar game of conquering planets and beating the
computer's empire with your empire.
Conquest (at least the version I had) normally opens its own little
RAW: window. You must click on the RAW: window to make it active in
order to talk to the Conquest game (well, initially, the Conquest RAW:
window is active, but if you click on something else, you need to
return to the Conquest's RAW: window to resume talking to the game.)
This isn't very friendly...
I patched my copy of the Conquest game to open "*" rather than a
"RAW:...". This makes it use the current Shell window. But, the Shell
window is NORMALLY line-buffered, rather than keystroke-interactive.
Well, I then wrote a script that ran my patched copy of Conquest, like
so:
set_raw ;; Turn Shell to RAW: behavior
conquest ;; Run patched Conquest in current shell
set_con ;; Return Shell to CON: behavior
This was nicer for playing in a Shell, and makes it a feasible "door
game" to run under a BBS, etc.
Also, as I recall, XLisp expected keystroke-interactive input, but the
port I dealt with didn't "know" how to do that with the CON: window.
By running set_raw before starting XLisp, I was able to get XLisp to
behave more like it should.
I find this extremely handy for occasional ARexx scripts that need to
read a Shell console without waiting for the user to press <Return>.
NOTE that when in RAW: mode, _all_ line-editing that the CON: window
provides is LOST. Back-space, delete, left/right/up/down arrows, etc.,
are all gone.
set_raw/set_con are REQUIRED by config-editor. Put them in your path
somewhere.
Do NOT leave a Shell window in "set_raw" (RAW:) mode. Doing so makes the
shell difficult to use (not impossible, but difficult). If you ever find
that a Shell window "just sits there" when you type at it (no text echoed
to your screen, etc.), it may be in "RAW:" mode. To fix it, try this:
type a control-J (^J, <Ctrl>-<J>, however you wanna describe
it...*grin*).
Type the word "set_con" (if you make ANY typos, type ^J and start over;
do NOT attempt to "edit" with the backspace, as "editing" won't do any
good).
Type another ^J after you think you correctly typed "set_con".
If you did it correctly, if set_con was on your command search path, and if
the problem really was that your Shell was left in RAW: mode, this should
fix it.