tags:

views:

39

answers:

1

This syntax doesn't work:

>> do load/header {rebol [Title: "Hello World"] Print System/Header/Script/Title }
** Script Error: Invalid path value: Header
** Near: Print System/Header/Script/Title

I want to get the meta-data in header.

My goal is mostly to be able to execute a whole rebol source including header to the clipboard and execute it in console by doing something like do read clipboard:// that doesn't work if I include the header, I can't strip it since I need it.

+2  A: 

Rewritten in response to comment.

Use load/header/next to create a two-item block: the script header followed by the script content:

loaded: load/header/next {rebol [Title: "Hello World"] Print "this is my script"^/a: 99 + 5 print a}
probe loaded/1   ;; shows the header
do loaded/2      ;; executes the script
Sunanda
Sorry I didn't explain the goal: My goal is to be able to execute a whole rebol source including header to the clipboard and execute it in console by doing something like do read clipboard:// that doesn't work if I include the header, I can't strip it since I need it.
Rebol Tutorial
rewritten to address your clarification
Sunanda