Basic Script Calling Commands
[1/6] from: benminton::austarnet::com::au at: 30-Oct-2003 17:58
Hi List.
Today, I bit the bullet, installed another hdd.
Reinstalled RedHat with a GUI. Got Rebol/View.
At the console prompts >> , what is the command to
call any script?
I tried Do %script.r and got an Access Error Message :
cannot find ....
Does this mean that I have placed Library.r into the
wrong location?
Thanks in advance,
Cheers, Ben
[2/6] from: SunandaDH:aol at: 30-Oct-2003 3:55
Hi Ben,
Welcome to REBOL!
> Today, I bit the bullet, installed another hdd.
> Reinstalled RedHat with a GUI. Got Rebol/View.
<<quoted lines omitted: 4>>
> Does this mean that I have placed Library.r into the
> wrong location?
I'm guessing here: REBOL/View is in one location and the script you want to
run is in another. In the REBOL console, try:
what-dir
to check your current directory. and then
change-dir /xxx/xxx/xxx
to change it to where the script you want to execute is.
'Do should now work -- but you may get a security warning as you are trying
to execute a script outside of the "sandbox" (ie the folder that REBOL.exe is
in, or any of its children).
If you have downloaded library.r from REBOL.org and put it in (say)
/rebol-lib, then you can:
1. do /rebol-lib/library.r -- to unpack all the scripts and build the search
indexes. Then after that:
2. do /rebol-lib/run-librarian.r -- to run the librarian front end
3. do /rebol-lib/scripts/xxxx -- to run a script in the library
Good luck!
Sunanda.
[3/6] from: carl:cybercraft at: 24-Dec-2003 22:43
On 30-Oct-03, Ben Minton wrote:
> Hi List.
> Today, I bit the bullet, installed another hdd.
<<quoted lines omitted: 3>>
> I tried Do %script.r and got an Access Error Message :
> cannot find ....
Yes Do's right.
> Does this mean that I have placed Library.r into the
> wrong location?
Yes, or that REBOL's startup directory isn't where you think it is.
At the REBOL Console enter...
what-dir
to see what directory REBOL is currently pointing to, and...
list-dir
to get a directory listing. If REBOL's startup directory isn't the
one you want it to be, then you've probably just not entered its path
correctly when you installed View. I've had this problem, and found
it easiest to just un-install View then re-install it again. To
un-install, enter...
set-user
at the Console and click on un-install. This won't remove View or any
important files. All it'll mean is that when you run View again
you'll be put through its install process again, including where its
home directory should be. This should be entered in REBOL file
format. ie %/home/rebol/ or whatever.
Hope that helps. (Mostly written from memory, but I think it's
correct.)
--
Carl Read
[4/6] from: antonr:iinet:au at: 31-Oct-2003 10:59
Ah a new linux guy.
You may want to put these lines in your
user.r for more familiar file system navigation:
cd: :change-dir
ls: :list-dir
wd: :what-dir
Usage:
cd %adir/
Anton.
[5/6] from: carlos::lorenz::bol::com::br at: 3-Nov-2003 19:19
Re: Basic Script Calling Command
Wow!
How come I have never thought about this before?
Thanks Anton
Carlos
Em Quinta 30 Outubro 2003 21:59, Anton Rolls escreveu:
[6/6] from: antonr:iinet:au at: 5-Nov-2003 17:43
I don't know the answer to that, but
I have made dir-utils.r, with more powerful
cd and ls functions. I use them constantly.
http://www.lexicon.net/anton/rebol/library/dir-utils.r
You can extract the functions from that object
and stick them in your user.r or you could use my include
function. Full example:
site: select load-thru http://www.reboltech.com/index.r [folder "Anton"]
clear find site %index.r
do load-thru site/library/include.r
include [
site/library/dir-utils.r [cd ls] ; there are other functions
]
; now you can use cd and ls in console... eg.
; ls/info
Find the code in your public cache here:
path-thru site/library/dir-utils.r
If I were you, I'd also define a function edit which
launches your preferred native editor. Very handy.
Here's mine on windows.
edit: func ["Open native editor"
file [file! string!] "document to open in editor (can be empty string)"
/local exe
][
exe: %/d/Anton/Dev/EditPlus/EditPlus.exe
call reform [
either file? exe [to-local-file clean-path exe] [exe]
either file? file [to-local-file clean-path file] [file]
]
]
Anton.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted