Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Execute rebol from java

From: nitsch-lists:netcologne at: 4-Jan-2002 14:48

RE: [REBOL] Re: Execute rebol from java Hi Anton, ups, no, drop my version!! Hallvards is a lot better! wasnt aware the class with readLine() anymore.. Long time not really touched java.. (there was no answer for i while so i tried it ;-) i think you can drop the error-stream there and use try { Process p = Runtime.getRuntime().exec("Your command here"); BufferedReader pi = new BufferedReader (new InputStreamReader(p.getInputStream())); while ((s = pi.readLine()) != null) { //here you have a rebol-line in 's, do something with it System.out.println(s + "\n"); //show it for example } } catch (Exception e) { e.printStackTrace(); } (thank you Hallvard :) [arolls--idatam--com--au] wrote:
> Volker, > I got your project working ok, but > I am still struggling to see the output. >
usually ides have a console-output-window somewhere hidden..
> I have tried squishing Hallvard's > output code in place of yours, > in RebolConnection.readAll method, > because it looks a little more > cross-platform (?)
Yes. and shorter. and more clear and all that :) simply process the strings he outputs,
> But wait! Aren't rebol line-terminators > always '\n'?
not if you print them? converted os-dependend like with files? hmm, don't know.
> Then that's what you had originally! > > (I admit I am a bit confused where > it's going.) > > I will see if I get anything from the console > later. (I haven't used java from the console > for a long time.) > > Thanks... >