REBOL Quick Start, Part Two
The second part of the Quick Start tutorial, found on the REBOL Technologies site. Begin by going there.
It starts out with a REBOL script, the same one used in Quick Start part 1. We remove some of the program code, the function that resizes the clock when you click and drag a corner. We also see what happens if we make a typing mistake.
We start customizing by changing the header of the script.
This top part of the script is called the REBOL header. EveryREBOL script contains a header. If there is no header, REBOL will not run the script.
The header is a block of information about the script, the version of REBOL that it requires, any modules or scripts it requires, the version of the script, the name of the author, the date of creation or modification, and similar information. This information is not all required, but including much of it will help a programmer when checking to see if this is the correct script and version for the intended purpose.
The code body is the actual programming code that the script runs. The variable f stands for the layout function, which is called by the main program in order to do its work. f: layout [
This appears to be similar to the way things are done in such programming languages as Pascal and C. Traditionally, each function is designed to perform a specific task and the main part of the program calls them as needed. This localizes the code needed to perform a task, meaning that it is easier to modify or update the script as needed.
Carl Sassenrath, the creator of REBOL, then shows us how to change colors and display effects in the clock. He then assures us that our changes are only available locally, rather than affecting everyone who visits the REBOL site or uses REBOL/View to run these demo scripts.
This concludes this part of the Quick Start tutorial. Play around with the code a little. See if you can figure out how to do something with the knowledge we’ve just gained. Stick around. There’s more to come!
technorati tags:REBOL, tutorial
Blogged with Flock


