REBOL Quick Start, Part Two

Posted on Monday, 2007-February-05. Filed under: REBOL |

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:,

Blogged with Flock

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

    About

    Mostly Free / Open Source Software, with a little non-free too

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...