Murray Eisenberg wrote:
>The suggested verb "query" won't work, even
> after r_pl.ijs is loaded, because "echo"
> gives a value error!
Oops, sorry, my oversight. I created the example "interactive" script with
jconsole.exe, not j.exe, in mind.
The profile for jconsole defines echo; the synonym in j.exe is smoutput. This
script should work for both j.exe and jconsole:
require '~temp\r_pl.ijs strings'
query =: verb define
if. 'quit' -: deb tolower y do.
0 ; 'bye!'
else.
_ ; 'Why do you say "', y , '"?'
end.
)
0 0 $ 1!:2&2 'Welcome to psychotherapy!'
query r_plx ''
remember to use r_pl instead of r_plx if you wish J to continue running
after "bye!". If you use r_plx , after "bye!" the J window will close
(without prompting, saving open scripts, etc).
I tested it this time. See a screenshot here:
http://bron.us/interactive-jexe.png
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm