This example shows how to run a script from the console or from another script.
‘To run any script, you can type:
The do word means load the file
script.r and evaluate it. (Note that in REBOL, they evaluate code, not execute it.)
% indicates that the string following it is a file name or file path. It’s a unique datatype called file! That’s an important. REBOL has a several different string datatypes and you will use them for different purposes. More on that later, but for now, just don’t forget the % in front of the filename.
You can put do in scripts too. That’s how you include other files in your program.
do %dictionary.r do %html-tags.r do %html-forms.r do %name-database.r
This would evaluate and include four other files in your program.
The filename can be a variable also. For example:
tagfile: %html-tags.r do tagfile
So, you could even do something clever like:
foreach file [%dictionary.r %html-tags.r %html-forms.r] [ do file ]