Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

newbie: run .r

 [1/6] from: mike:mirby at: 15-Jan-2002 12:55

I just started using rebol. Wanted to know how to run a *.r file in REBOL VIEW -thanks -- Binary/unsupported file stripped by Listar -- -- Type: application/ms-tnef -- File: winmail.dat

 [2/6] from: slok00::yahoo at: 16-Jan-2002 3:26

At 12:55 PM 1/15/2002 -0500, you wrote:
>I just started using rebol. >Wanted to know how to >run a *.r file in REBOL VIEW > >-thanks
Example: let say you have a file called "HelloWorld.r" 1. put it in rebol\view\local 2. edit index.r in rebol\view\local 3. key in the following line in index.r file "HelloWorld" %HelloWorld.r 4. save the file 5. launch REBOL VIEW 6. goto Local 7. You should be able to click on a "HelloWorld" did I miss anything? YekSoon

 [3/6] from: al:bri:xtra at: 16-Jan-2002 9:02

> I just started using rebol. > Wanted to know how to > run a *.r file in REBOL VIEW
An alternative solution is to: 1 Run Rebol/View; 2 Click on the Console icon; and 3 Type the following: do %/c/rebol/MyRebolScript.r Or, if Rebol/View is installed, simply click on the rebol script file. Andrew Martin ICQ: 26227169

 [4/6] from: rebol665::ifrance::com at: 15-Jan-2002 21:53

Hi, Part 1 You are in the desktop. Click on the console icon. From here you just have to type : do %myprogram.r. (do not forget the % that indicates a file ) Part 2 You want to run a program from the desktop. You will have to put the program name in a special file. Right click on the local folder, and edit the index.r file. An index file is like this REBOL [Title: "Local Index" Type: 'index] title "Local Files" folder "miniskin" %/d/rebol/local/mini-aqua-blue/index.r file "Tetris" %/d/rebol/local/library/rebtris.r You will find a full explanation of the desktop usage in the RT site ( HTH Patrick

 [5/6] from: jason:cunliffe:verizon at: 15-Jan-2002 17:22

1. In REBOL/View click on the console icon: 2. check where you are:
>> what-dir
== %/C/rebol/view/ 3. check to see if the file you want to load is visible by showing the contents of the directory you are in:
>> list-dir
afile.png anindex.html attach.r barchart.r bay.jpg bay.png buddha-script.r test.r ... etc ... etc 4. if it is visible run it: "do" is the magic word to run scripts
>> do test.r
** Script Error: test.r has no value ** Near: do test.r oops!!??? ... oh yeah forgot to include % before the file name ALWAYS* [*unless an alias or some other REBOL code already includes it]
>> do %test.r
just testing %test.r <== the output when I run test.r That's It :) but wait there's more... 5. If your file is not in the current directory you have 3 choices: a. move it there ['save as' or move or copy] b. move yourself to where script is c. run script from where you are now Suppose your file is in %/c/rebol/tools/
>> list-dir %/c/rebol/tools
REBOL will probably pop up a box: REBOL Security Check Script requests permission to open a port for read only on /c/rebol/tools Yes | Allow All | No | Quit So click 'Yes' or 'Allow All'
>> list-dir %/c/rebol/tools
** Access Error: Cannot open /c/rebol/tools ** Where: throw-on-error ** Near: list-dir %/c/rebol/tools fuck you lie! Hmm.. let's try again. you can retype or if llazylaousy ltypist liek me use the keyboard up arrows to recall the last thing you typed. [experiment with all the arrows, home, end, pageUp, pageDown and TAB keys] revise your input so it reads:
>> list-dir %/c/rebol/tools/ <== the last "/" is important addbox.r
addimagebox.r addimagebox.r.bak aliases.r ...etc ...etc test.r You can also show the results in relative style like urls:
>> list-dir %../tools/
likewise you can run scripts in another location:
>> do %/c/rebol/tools/somescript.r
>> do %../tools/somescript.r
Relative style is much more portable, and usually less typing. When you are tired of paths, just move to the directory where your script is:
>> change-dir %/c/rebol/tools/ >> what-dir
== %/c/rebol/tools/ 6.
>> ? dir
Found these words: change-dir (function) dir? (function) dirize (function) list-dir (function) make-dir (function) mkdir (function) what-dir (function) Remember ? is your #1 REBOL friend TAB is #2 friend. Type a little bit of some recent input, and then hit TAB a few times and see what happens [auto completion]
>> what ;[shows all the available words]
7. you can set up permanent aliases if these REBOL dir commands drive you nuts: create a file called say "aliases.r". Mine looks lives in %/c/rebol/tools/ and looks like this: ============================== REBOL [] ; jason lazy aliases aliases: [ cd: :change-dir ls: :list-dir pwd: :what-dir mkdir: :make-dir ] reduce aliases print "aliases loaded" ==============================
>> do %/c/rebol/tools/aliases.r
makes my aliases available Since I want these to be avaiable by default I add this command into %/c/rebol/view/user.r Every time Rebol/View starts it will now automatically load aliases.r Whenever I get around to it I will jazz up my alias definitions to mimic my linux shell habits btter, add other cool stuff, shortcuts etc. This technique can be widely exanded for all sorts of features and script goodies you may want to include. But beware doing this until you knweo the REBOL defaults and if you punlish your scripts make sure any customizations are considered. This way your code will be easy to read and will run correctly. 8. BACK to VIEW
>> desktop
hth ./Jason

 [6/6] from: mike:mirby at: 15-Jan-2002 18:40

Thanks for all the help guys! -- Binary/unsupported file stripped by Listar -- -- Type: application/ms-tnef -- File: winmail.dat