Comments on: Using R3 within an editor on Win32

Carl Sassenrath, CTO
REBOL Technologies
28-Oct-2009 6:19 GMT

Article #0284
Main page || Index || Prior Article [0283] || Next Article [0285] || 9 Comments || Send feedback

With the stdio changes made to A93 it's now easier to setup and use R3 within various code editors.

For example, I tested R3 with the latest version of Crimson Editor:

(See this note for setup details.)

When I hit CTRL-E (to evaluate the script) the panel at the bottom immediately displays the output of R3. The console window does not open.

Try A93 with your own favorite editor, IDE, or other environment and tell us how it does.

Unicode Note

I should note that the redirected input and output are always UTF-8 (or just ASCII, depending on your usage), so your editor will need to account for that if you use Unicode.



28-Oct-2009 5:58:36
So much for an editor, but how do I start my R3 from a shell, not opening its own window? I would like to use it with Console2 or PowerShell. Is that possible with latest changes?
Carl Sassenrath
28-Oct-2009 8:30:30
A good question. To not open the R3 window, simply redirect its stdout stream (and often both stdio streams.)

In the setup options for those programs add a line like:

r3 -q <input >output

Of course many tools already know that, and do it automatically (like the editor example above.)

When you get it working, please post the lines here for other users to see. Thanks.

28-Oct-2009 10:04:03
Works flawlessly with SciTe
>C:\Usr\Program\Rebol3\r3.exe C:\Usr\Work\test.r
Checking for rebol.r file in /C/Usr/Program/Rebol3/

Evaluating: /C/Usr/Work/test.r
>Exit code: 0
28-Oct-2009 13:51:21
For those of you who want to configure Crimson like Carl's example, do the following:

1. Select View / ToolBar/Views then select "Directory Window"

2. Also select "Output Window"

3. Select Tools / Preferences and check "Capture Output"

Brian Hawley
28-Oct-2009 18:12:35
Console2, PowerCMD and remote cmd.exe shells don't go through stdio, they use the console APIs. We can't tell them to do I/O redirection. The only way to make them work is by making a console app version of R3, rather than a GUI app that allocates a console rather than a GUI.
Adrian Sampaleanu
29-Oct-2009 19:35:18
I think I have everything the way it should be, using the SourceForge version of Crimson Edit (Crimson Editor SVN263 English in the About box), and all I get when evaluate the following script:

print "Hello World"


---------- Capture Output ----------
> "C:\dev\r3\r3-view.exe" -s "C:\dev\r3\test.r"
> Terminated with exit code 0.

I am capturing output. Should I be using the old version?

Carl Sassenrath
30-Oct-2009 13:36:18
I'm using Crimson 3.60 from their website... and it seems to work fine. (I just downloaded it last week.)

The above example shows:

---------- Capture Output ----------
"C:\rebol\view.exe" -sq "C:\Program Files\Crimson Editor\test.r"
hello world
Terminated with exit code 0
31-Oct-2009 9:05:56
I've tested with perfect text editor called EditPlus on Windows. It works very well. Configuration is very simple, just add the R3.exe to the Tools and check the Capture Output option. Here is the output:

---------- R3 ---------- Checking for rebol.r file in /D/Rebol/R3/ Script: "Untitled" Version: none Date: none this is rebol.r

Evaluating: /D/Rebol/R3/test.r hello world

Output completed (0 sec consumed)

2-Nov-2009 5:21:45
EditPlus was not support to capture UTF8 output of a program yesterday. I send them a feature request and today it supports UTF8 :) They made it just in a few hours. Nice support :)

Post a Comment:

You can post a comment here. Keep it on-topic.


Blog id:



 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

Updated 25-Jun-2024 - Edit - Copyright REBOL Technologies -