[REBOL] Re: do %image.png
From: ingo:2b1 at: 15-Nov-2001 10:18
Hi Jason, Ryan,
Once upon a time Jason Cunliffe spoketh thus:
> "Ryan Cole" <[ryanc--iesco-dms--com]> wrote
> > Should be even easier than that. Just insert something like this into
> it...
> >
> > REBOL[]
> > confirm "This is a test."
> > halt
> >
> > Just make sure you have the code enveloped in linefeeds. REBOL was
> designed to
> > do this already.
>
> Hi Ryyan
> I don't quite understand you.
> ..what "this" REBOL was design to do ?
Rebol was designed to be run when imbedded into other data,
e.g. you can run a script directly from an email, without
having to clean it first.
So, you can 'do %image.png if the script itself is stored in
normal ASCII within the binary data, but it Won't work the way
Ryan suggested, the way to go is, embed the whole script into
a block, like this
[REBOL []
print {
You can save this email, e.g. to %mymail.r,
and 'do %mymail.r in a REBOL session.
}
]
> How will wrapping my embedded script in linefeeds help?
> How will I know I am at the end of my script and at some space in the middle
> of it?
(IIRC, the rules are:
find newline followed be "REBOL" and a block
--> starting from REBOL unto the end is a rebol script
find newline followed by "[REBOL" and a block
--> the script ends at the closing bracket
I hope that helps,
Ingo