⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.txt

📁 REBOL core 请大家不要下载
💻 TXT
📖 第 1 页 / 共 2 页
字号:
(or the directory of the script being run), then in the
directory that contains the REBOL executable program.

<I>Note that REBOL/Core runs fine without the rebol.r and user.r
files. They simply provide an easy way to include additional
code and data on startup, such as your network preferences.</I>

---Script Security

REBOL stays on the safe side by not allowing scripts to modify
or delete files unless you let them.

In addition, REBOL offers a variety of security settings that
control file and network security, including file and directory
"sandboxes" (areas where scripts are permitted to access files).

In REBOL/Core the default security lets scripts only
modify or delete files in the script's current directory,
<I>nowhere else</I>. Changing files anywhere else requires user
approval.

For trusted scripts, you can run REBOL with security disabled.
This mode lets scripts do anything (including delete files). To
run in this mode, start REBOL with the -s option:

	REBOL -s script.r

When running this way, be sure to <B>only run scripts that you
have written or scripts that you trust completely</B>.

If you want to run scripts with full security for read and
write, you can specify the +s command option:

	REBOL +s script.r

Now REBOL will prompt you each time your script tries to do
anything, including simply reading a file.

\note Security Warning

Note that only you, the user, can change the security.

When running REBOL, if you receive a security warning, <B>do not
approve a change of security or allow file operations if you do
not trust the script</B>. Inspect the script first before
running it or obtain the script from a trusted source.

There is no way for a script to lower the security level without
your approval. Changes can only be made from the command line
(with options like -s, +s, and --secure) or from the popup
security warning.

/note

See the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-2.html"><B>Operation
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for more
information about security.

---Quitting REBOL

You can quit REBOL at any time by typing: 

	quit

or just:

	q

Note that typing the word EXIT will result in an error message,
because EXIT is a word used to return from REBOL functions.

If your script was run in CGI mode, it will automatically
quit when it has finished.

===Network Setup

If your computer has direct access to the Internet, then you can
run REBOL/Core without any network setup.

If your computer uses a proxy server to access the Internet, you
will need to provide settings to allow REBOL to make connections
through the proxy.

If you want to use the SMTP email protocol (for example, use the
SEND function to send email), you need to provide a reply
address and mail server name.

Network setup can be provided in each script that you run or in
your user.r file that is loaded each time you run REBOL. Both
methods have their advantages.

---Basic Concepts

REBOL provides the SET-NET function to make it easy to specify
your email and network settings.

For example, within a script you can use:

	set-net [user@example.com mail.example.com]

to set your email reply address and the name of your SMTP email
server.

Set-net can also set your POP and proxy server information.
See more below.

Note that SET-NET is just a shortcut function for quick setup.
Many other network setup parameters are available, such as
network timeouts for each protocol.

See the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-13.html"><B>Networking
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for full
details.

---Interactive Setup

You can ask REBOL to prompt you for network information by running
the setup.r script that is included with this distribution. Once
the network questions have been answered, REBOL will create a
user.r file with your correct network settings within it. 

To run the setup script, start REBOL, then type:

	do %setup.r

or, just run REBOL with the setup.r script:

	REBOL setup.r

The script will ask you a few questions:

#The first question will request your email address. Type it as
you would normally. For example, name@domain.com. 

#The second question asks for the name of your email server. If
you do not know it, check the settings or options menu of your
current email program. Hint: if your email address is
bob@example.com, your email server may be mail.example.com. 
Otherwise, contact the network service provider for the name of
the email SMTP  server. 

#The third question asks if you use a proxy server. If you are
directly connected  to the Internet with a modem or ethernet,
then the answer is N for no.  Otherwise, read the following
section on proxy setup.

If you make a mistake or later decide to change any of these
network settings, just run the setup.r script again.

Note that you can terminate the setup script at any time by
pressing the ESCAPE key. 

When complete, all network settings are stored in your user.r
file, and it can be modified with any text editor. The network
setting appear in a line the begins with SET-NET. For example:

	set-net [luke@rebol.com mail none none]

This line can be modified to provide your startup network
configuration.

---Proxy Servers

Some organizations use a proxy server to access the Internet. A
proxy server is a gateway that routes network connections from
an internal network to the external Internet. To operate REBOL
with these systems, you will need to provide additional network
information. 

In the interactive setup above, when REBOL asks if you use a
proxy, answer by typing a Y for yes. You will then be prompted
for the name of your proxy host. This is the server that
operates as a proxy.

Next, you will be asked for the port number used by that system
for proxy requests. Typically, this is port 1080 for SOCKS proxy
servers, but it can vary depending on your proxy setup. If you
do not know, look at your Web browser's proxy settings or ask
your network administrator. 

REBOL defaults to using the SOCKS proxy protocol. You can
specify other types of proxies by editing your user.r file and
supplying the SET-NET function with the appropriate
identification for the type of proxy being used.

These proxy types are supported: 

	socks   - use the latest SOCKS version (5)
	socks5  - use socks5 proxy
	socks4  - use socks4 proxy
	generic - use generic CERN proxy
	none    - use no proxy

For example, to setup a proxy with SET-NET in your user.r file,
you might write a line like this:

	set-net [you@example.com mail none proxy.example.net 1080 socks]

See the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-13.html"><B>Networking
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for more information.

===REBOL Scripts

REBOL scripts are written as plain text files. You can easily
create or modify them with any text editor.

---REBOL File Suffix

REBOL scripts typically appear with a .r suffix for file names;
however, this is just a convention and is not required. The
interpreter reads files with any suffix and scans the contents
for a valid REBOL script header.

The example command line below will examine the example.txt text
file for a REBOL header, and if it is found, will run the REBOL
code that follows the header:

	REBOL example.txt

This is also true of files run from within REBOL, such as:

	do %example.txt

and even:

	do http://www.example.com/test.html 

---REBOL Headers

Every script must begin with the word REBOL followed by a header
object that provides information about the script. Headers have
many uses, including identification, documentation, revision
tracking, and script requirements.

A minimal script header would be:

	REBOL [Title: "Example Script"]

But, it is a better practice to provide more information in your
header. Here is an example:

	REBOL [
		Title: "Example Script"
		Date: 24-mar-2003
		File: %include.r
		Version: 1.2.3
		Author:  "Luke Lakeswimmer"
		Purpose: {
			Just show the folks how it's done.
			What could be simpler.
		}
	]

	print read http://www.rebol.com

See the <A HREF="http://www.rebol.com/docs/core23/rebolcore-5.html"><B>Scripts
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for complete
details about scripts and their headers.

---Converting Line Terminators

Different operating systems use different characters to
terminate lines. For example, Windows uses the CR and LF
characters, whereas Unix/Linux uses just LF.

<I><B>REBOL does not care about line terminators.</B></I> It
will properly handle files with any standard type of line
termination.

However, if you are editing scripts created by other REBOL
users, <I>your text editor may not like the terminators</I>.
Fortunately, REBOL can easily convert the lines terminators
to the format used by your computer. To do so, just read
the text file and write it back. For example,

	write %example.r read example.r

will convert the example.r file to use the correct line
terminators for the local operating system.

This example converts all the .r files in a directory:

	foreach file load %. [
		if (suffix? file) = %.r [
			write file read file
		]
	]

<I>Note: Do not use this on binary files such as program
executables, or they may be corrupted.</I>

---Script Compatibility

It is always a good idea to use the most recent version of REBOL
for running scripts. Newer versions of REBOL provide new
functions and features not found in older models. With very few
exceptions, older scripts will run on newer versions of REBOL.

When REBOL/Core runs, it prints its version number to the console.
You can also obtain its version with a line such as:

	print system/version

You can also determine what REBOL product you are running with
the line:

	print system/product

Other system information is also available. To see a full list
of system variables, type:

	help system

===Platform Specific Notes

---Windows

In Windows, the REBOL console lets you cut, copy and paste lines
of text. To copy, select text with the mouse, then use  the
Edit/Copy menu or Ctrl-C to copy selected text to the clipboard.
Use Edit/Paste or Ctrl-V to paste text from the clipboard to
REBOL. Or, use the right mouse button to access a Copy/Paste
pop-up menu. 

On the REBOL console interface for Win32 machines, the Ctrl
(control) versions of the cursor keys scroll the display up and
down.  Control-page-up and control-page-down scroll a page at a
time. Control-home and control-end scroll to the first and last
line of the display. These control sequences are not passed to
the console input port. 

The REBOL console on Windows machines offers an option
(File Settings) to "Use window width" that will wrap lines at
the current window's width.  Otherwise, it will wrap at the
length in the "Terminal width:" box. As with other platforms,
resizing the window's width will not refresh text on the 
screen. If you prefer, turn "Use window width" off by unchecking
the box.

---Mac OS X

Under OS X, REBOL/Core is just a shell executable file that uses
standard input and output. It does not by default work as an
executable icon. You run REBOL by opening a terminal and typing
the command line (as shown above) or by running a shell script.

---Macintosh

REBOL, by default, only reads and writes the data fork of
Macintosh files, not the resource information. This means that
using REBOL to read and write certain types of files will not
produce the desired results.

REBOL 2.5 provides the ability to specify the fork of Macintosh
files. This is done with the custom READ and WRITE settings
and also the SET-MODES and GET-MODES functions.

For example:

	read/binary/custom %file [fork  "resource"]

---UNIX and Linux

REBOL uses the TERMCAP entry provided by UNIX-based systems. If
some of your function keys are not operating properly, you will
need to setup your computer's TERMCAP entry. 

Default file permissions include read and write permissions for
the user and for the user's group, and read permissions for all
others.

---Amiga

Use Amiga's Tool Types to set the REBOL icon to the REBOL
executable file.

---BeOS

REBOL for BeOS is run from a terminal window rather than a
console. To open a terminal, click on the Be menu, then choose
the Applications sub-menu, and  select Terminal. Type the path
to the REBOL executable program and press  ENTER. 

Default permissions now include read and write permissions for
the user and for the user's group, and read permissions for all
others.

###

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -