[REBOL] Re: output redirect to variable
From: al:bri:xtra at: 30-Dec-2002 15:32
Nicholas wrote:
> Is there a way to save (redirect) output to a word? For example:
>
> >> ;line of code would be place here to redirect the output buffer to the
> word "saved-output"
> >> print "hello world"
> >> ;line of code that would be return output to console
> >> print saved-output
> hello world
> >>
>
> For those who know ColdFusion -- I am trying to replicate the
cfsavecontent
> tag.
Here's one way to save console output to file:
>> help echo
USAGE:
ECHO target
DESCRIPTION:
Copies console output to a file.
ECHO is a function value.
ARGUMENTS:
target -- (Type: file none)
(SPECIAL ATTRIBUTES)
catch
Another way is like:
>> print X: rejoin ["Then answer is: " 1 + 5]
Then answer is: 6
>> print X
Then answer is: 6
I hope that helps!
Andrew Martin
ICQ: 26227169 http://valley.150m.com/