Home   Archive   Permalink



The word-browser.r reference

When I was learning Rebol, this old R2 script was invaluable:
    
     do http://re-bol.com/wordbrowser.r
    
It presents nicely formatted help text and clickable examples which clarify how all Rebol's functions work. The majority of the Rebol language is covered, and everything is organized into helpful categories, and cross referenced with other related functions, so you can quickly find and use the code you need. It's a fantastic way to learn the language!

posted by:   Nick     12-Jan-2014/23:03:33-8:00



I created a poor man's quick reference script a while back:
    
     R E B O L [Title: "Quick Manual"]
     print "This will take a minute..." wait 2
     echo %words.txt what echo off ; "echo" saves console activity to a file
     echo %help.txt
     foreach line read/lines %words.txt [
         word: first to-block line
         print "___________________________________________________________^/"
         print rejoin ["word: " uppercase to-string word] print ""
         do compose [help (to-word word)]
     ]
     echo off
     x: read %help.txt
     write %help.txt "VID STYLES (GUI WIDGETS):^/^/"
     foreach i extract svv/vid-styles 2 [write/append %help.txt join i newline ]
     write/append %help.txt "^/^/LAYOUT WORDS:^/^/"
     foreach i svv/vid-words [write/append %help.txt join i newline]
     b: copy []
     foreach i svv/facet-words [
         if (not function? :i) [append b join to-string i "^/"]
     ]
     write/append %help.txt rejoin [
         "^/^/STYLE FACETS (ATTRIBUTES):^/^/" b "^/^/SPECIAL STYLE FACETS:^/^/"
     ]
     y: copy ""
     foreach i (extract svv/vid-styles 2) [
         z: select svv/vid-styles i
         ; additional facets are held in a "words" block:
         if z/words [
             append y join i ": "
             foreach q z/words [if not (function? :q) [append y join q " "]]
             append y newline
         ]
     ]
     write/append %help.txt rejoin [
         y "^/^/CORE FUNCTIONS:^/^/" at x 4
     ]
     editor %help.txt
    
The results are saved in a file named help.txt, and displayed using Rebol's built in text editor. Using the editor, you can rename the file and save it anywhere on your hard drive, make notes and write in your own examples, etc., for future reference.

posted by:   Nick     12-Jan-2014/23:06:15-8:00



Thank you for that word browser. I have included it in a little control panel I am working on for helping me write programs.

posted by:   Steven White     13-Jan-2014/14:20-8:00



Hey Steve,
    
If you need word-browser to be portable, notice that it downloads 2 additional files:
    
http:re-bol.com/word-cats.r
http:re-bol.com/word-defs.r

posted by:   Nick     13-Jan-2014/19:42:57-8:00



The word-defs.r file has all the content.

posted by:   Nick     13-Jan-2014/19:45:48-8:00



why do I continue to get this error.
    
REBOL Word Browser
    
** Syntax Error: Script is missing a REBOL header
** Near: do/args script system/script/args

posted by:   ron     28-Jan-2014/7:24:08-8:00



When do you see that error?

posted by:   Nick     28-Jan-2014/9:43:11-8:00



when I click on the script I made.
    
I just highlighted the text you wrote , put it in my notepad ++ renamed it to refer.r and then try and double click it, the rebel interrupter starts and displays this

posted by:   ron     28-Jan-2014/11:15:30-8:00



Oh, hehe, notice that there are spaces in the "R E B O L []" header above. My little rebolforum script does that automatically to avoid problems with unintentionally running code in posts. Just delete the spaces in the header.

posted by:   Nick     28-Jan-2014/12:54:53-8:00



that would be the answer to many of the issues I have been having...ty

posted by:   ron     29-Jan-2014/11:12:08-8:00