If you wrote the script, or if you modify the script's
header before doing it, then you can make the script
content available by setting CONTENT: TRUE in the header.
eg.

>> write %afile.r {rebol [content: true] print "hello" probe
system/script/header/content}
>> do %afile.r
Script: "Untitled" (none)
hello
{rebol [content: true] print "hello" probe system/script/header/content}
== {rebol [content: true] print "hello" probe system/script/header/content}

I remember there was a quine (a program which reproduces itself)
which used this method.

Anton.

> Hi Carl,
>
> CR> After a script is running, is the source stored somewhere where it
> CR> can be accessed, or would you have to load it again from disk?
>
> It isn't available...normally, but REBOL being what it is, a simple
> twist will make it available. Just define your main script as a block
> and DO it at the end, then that block will be available to you.
>
> my-source: [
>     print 'testing
>     b: copy []
>     append b [1 2 3]
> ]
> do my-source
>
> -- Gregg

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to