[Newbie]: Rebol script output to Windows stdout
[1/9] from: dgarrard:nufocusinc at: 5-Jul-2004 17:02
I am wondering if Rebol can be called in a Windows shell execute/execprogram
mode with the goal of returning test to stdout.
I was hoping that a variation of 'print' would do it for me.
TIA
David Garrard
[2/9] from: greggirwin:mindspring at: 6-Jul-2004 8:34
Hi David,
DG> I am wondering if Rebol can be called in a Windows shell execute/execprogram
DG> mode with the goal of returning test to stdout.
DG> I was hoping that a variation of 'print' would do it for me.
Have you tried launching it (REBOL) with the -c option, to run it CGI
mode? That should do the trick. Then just PRINT as normal.
-- Gregg
[3/9] from: dgarrard:nufocusinc at: 8-Jul-2004 9:20
>DG> I am wondering if Rebol can be called in a Windows shell
execute/execprogram
>DG> mode with the goal of returning test to stdout.
>DG> I was hoping that a variation of 'print' would do it for me.
Gregg Irwin wrote:
>Have you tried launching it (REBOL) with the -c option, to run it CGI
>mode? That should do the trick. Then just PRINT as normal.
Running Rebol/Core 2.5.6.3.1 on Windows XP, (and also tested with Win 95)
and running command.com. If I attempt to PRINT ["Hello world"] within a
script, I get no output to the command line. IE:
c:\REBOL\Rebol.exe helloworld.r -c
Script is:
REBOL [
Title: "Hello world script"
File: %helloworld
Date: 07/01/2004
Purpose: {PRINT "Hello world to console.}
Note: {
None
}
]
print ["hello world"]
quit
Any ideas? Seems so basic a task.
Thanks again,
David Garrard
[4/9] from: dgarrard:nufocusinc at: 8-Jul-2004 10:01
>DG> I am wondering if Rebol can be called in a Windows shell
execute/execprogram
>DG> mode with the goal of returning test to stdout.
>DG> I was hoping that a variation of 'print' would do it for me.
Gregg Irwin wrote:
>Have you tried launching it (REBOL) with the -c option, to run it CGI
>mode? That should do the trick. Then just PRINT as normal.
I realised after sending the previous e-mail that I had the options syntax
wrong. I get the same result (no piped output) with c:\REBOL\Rebol.exe -c
helloworld.r
---------------
Running Rebol/Core 2.5.6.3.1 on Windows XP, (and also tested with Win 95)
and running command.com. If I attempt to PRINT ["Hello world"] within a
script, I get no output to the command line. IE:
c:\REBOL\Rebol.exe -c helloworld.r
Script is:
REBOL [
Title: "Hello world script"
File: %helloworld
Date: 07/01/2004
Purpose: {PRINT "Hello world to console.}
Note: {
None
}
]
print ["hello world"]
quit
Any ideas? Seems so basic a task.
Thanks again,
David Garrard
[5/9] from: SunandaDH::aol::com at: 8-Jul-2004 10:44
David:
> Any ideas? Seems so basic a task.
As far as I know, REBOL's cross-platform-ness extends to console sessions in
a very annoying way -- it doesn't support them on any platform.
Even trying sneaky windows-only things like:
write %/con "hello console!"
doesn't seem to work.
One work around -- assuming you are happy to wait to the end of the REBOL
session to see the console messages: write to a temporary file and then type that.
Like this:
c:\REBOL\Rebol.exe helloworld.r -c
type output.txt
Script is:
REBOL [
Title: "Hello world script"
File: %helloworld
Date: 07/01/2004
Purpose: {PRINT "Hello world to console.}
Note: {
None
}
]
echo %output.txt
print ["hello world"]
quit
Sunanda
[6/9] from: g:santilli:tiscalinet:it at: 8-Jul-2004 20:01
Hi David,
On Thursday, July 8, 2004, 4:01:33 PM, you wrote:
DG> I realised after sending the previous e-mail that I had the options syntax
DG> wrong. I get the same result (no piped output) with c:\REBOL\Rebol.exe -c
DG> helloworld.r
You can't get it printed on the cmd.exe console, but you can pipe
it to other programs or redirect it to files etc.
I.e. try C:\REBOL\Rebol.exe -c helloworld.r | more
Blame Windows.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
[7/9] from: g:santilli:tiscalinet:it at: 8-Jul-2004 20:02
Hi SunandaDH,
On Thursday, July 8, 2004, 4:44:10 PM, you wrote:
Sac> As far as I know, REBOL's cross-platform-ness extends to console sessions in
Sac> a very annoying way -- it doesn't support them on any platform.
Actually the problem is only on Windows because it does not have a
real terminal.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
[8/9] from: brian:hawley at: 8-Jul-2004 20:05
Hi Gabriele,
At 08:02 PM 7/8/04 +0200, you wrote:
>Hi SunandaDH,
>On Thursday, July 8, 2004, 4:44:10 PM, you wrote:
<<quoted lines omitted: 3>>
>Actually the problem is only on Windows because it does not have a
>real terminal.
Not quite true. Windows has real terminal support, but RT chose
to implement their own instead of supporting it. Windows REBOL
versions are GUI apps rather than console.
There are certain advantages to implementing REBOL as a GUI on
Windows - in particular certain APIs depend on window messages,
which require a window to work. Console apps typically don't
allocate a window and vice versa. Still, there's no reason that
there couldn't be a console version of /Core or /Command, with
features like /View, clipboard:// and the system port missing
of course. Dual-mode is possible too. More work for RT though.
For now you can do stdio by piping, really the main advantage
to it anyway. Still, console would be nice, and on WinCE too.
- Brian
[9/9] from: g:santilli:tiscalinet:it at: 9-Jul-2004 12:44
Hi Brian,
On Friday, July 9, 2004, 3:05:16 AM, you wrote:
BH> Not quite true. Windows has real terminal support, but RT chose
BH> to implement their own instead of supporting it. Windows REBOL
BH> versions are GUI apps rather than console.
Does it support ANSI codes etc.? In Win98 too? If so, maybe you
should ask Carl to create a version of /Core that uses that.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted