Hi Mike

There is no formal mechanism for a script to return a value. There are
several distinct ways to use scripts:

1) As a function or object library. Then

do %my-script.r           ;loads the functions for use in the console or
within another script.

2) A script can set values for some global variables, which are then used
from the console or within a second script (more general case of 1) ).

In your example below, Script2.r could simply create a global variable:

(in Script2)
script2-return: [value1 value2 other-block "etc"]

Then Script1 can simply use 'script2-return in the code following the call
of Script2.

3) A script could write a file of results using 'load or 'write and these
could be read in by another script.

By designing scripts with these ideas in mind, it is probably not really
necessary to have an explicit return mechanism.

Hope this helps

Larry

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 02, 2000 5:37 PM
Subject: [REBOL] Return value from a Script???


> Hello,
>
> Is it possible for a script to return a value in a similar manner that a
> function does? I've suddenly realised that i have been developing scripts
> but don't seem to have any way for them to communicate with each other?
>
> As in:
>
> Script1.r
> REBOL []
>
> ...
>
> do/args %Script2.r arg
> <Have Script2 return a value>
>
> ...
>
> Thanks.
>
> Mike.
>

Reply via email to