[REBOL] Re: Execute rebol from java
From: arolls:idatam:au at: 7-Jan-2002 14:32
Cool, I got it all working. :) Thanks!
Volker, you should add to your callreboldemo.r
print "hello java"
wait 5
The window was popping up and disappearing so fast
I couldn't see the text at all!
But then I decided to make cgi work.
I noticed that the scriptAndArguments will be
parsed by StringTokenizer, only on these
characters: " \t\n\r\f".
There is no handling there of double quotes,
so if scriptAndArguments is for example
"-cs list-demos/callrebol-project/callreboldemo.r",
then rebol comes back with usage info as output. :-/
So I made a new String[], built from executable
and scriptAndArguments (which is also now a String[]),
so you can instead pass in
"-cs", "list-demos/callrebol-project/callreboldemo.r"
Changes in RunRebol:
// build cmdarray from executable and scriptAndArguments
String[] cmdarray = new String[scriptAndArguments.length + 1];
cmdarray[0] = executable;
for (int i = 0; i < scriptAndArguments.length; i++)
cmdarray[i + 1] = scriptAndArguments[i];
rebolProcess = runtime.exec(cmdarray);
Changes in main:
rebolConnection.scriptAndArguments = new String[]
{"-cs", "list-demos/callrebol-project/callreboldemo.r"};
// find the directory we start in
//{"-cs", "--do", "print what-dir"};
Thanks again!
Mmm, it would be nice to be able to check the
registry to see where rebol is installed.
Actually, what is a cross-platform way to do this?
Sounds many-platformed to me! But maybe there is
a simple way?
Rebol resolution!
Also it would be nice to run rebol all the time
from java, watch the error output, and see if
anything ever comes out. (It could be a waste of
time, though).
Anton.