📄 setup.html
字号:
<h3 id="section-3.2">3.2 Interactive Setup</h3>
<blockquote>
<p>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.</p>
<p>To run the setup script, start REBOL, then type:</p>
<pre>
do %setup.r
</pre>
<p>or, just run REBOL with the setup.r script:</p>
<pre>
REBOL setup.r
</pre>
<p>The script will ask you a few questions:</p>
<ol>
<li>The first question will request your email address. Type it as
you would normally. For example, name@domain.com.</li>
<li>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.</li>
<li>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.</li>
</ol>
<p>If you make a mistake or later decide to change any of these
network settings, just run the setup.r script again.</p>
<p>Note that you can terminate the setup script at any time by
pressing the ESCAPE key.</p>
<p>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:</p>
<pre>
set-net [luke@rebol.com mail none none]
</pre>
<p>This line can be modified to provide your startup network
configuration.</p>
</blockquote>
<h3 id="section-3.3">3.3 Proxy Servers</h3>
<blockquote>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>These proxy types are supported:</p>
<pre>
socks - use the latest SOCKS version (5)
socks5 - use socks5 proxy
socks4 - use socks4 proxy
generic - use generic CERN proxy
none - use no proxy
</pre>
<p>For example, to setup a proxy with SET-NET in your user.r file,
you might write a line like this:</p>
<pre>
set-net [you@example.com mail none proxy.example.net 1080 socks]
</pre>
<p>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.</p>
</blockquote>
<h2 id="section-4">4. REBOL Scripts</h2>
<blockquote>
<p>REBOL scripts are written as plain text files. You can easily
create or modify them with any text editor.</p>
</blockquote>
<h3 id="section-4.1">4.1 REBOL File Suffix</h3>
<blockquote>
<p>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.</p>
<p>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:</p>
<pre>
REBOL example.txt
</pre>
<p>This is also true of files run from within REBOL, such as:</p>
<pre>
do %example.txt
</pre>
<p>and even:</p>
<pre>
do http://www.example.com/test.html
</pre>
</blockquote>
<h3 id="section-4.2">4.2 REBOL Headers</h3>
<blockquote>
<p>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.</p>
<p>A minimal script header would be:</p>
<pre>
REBOL [Title: "Example Script"]
</pre>
<p>But, it is a better practice to provide more information in your
header. Here is an example:</p>
<pre>
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
</pre>
<p>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.</p>
</blockquote>
<h3 id="section-4.3">4.3 Converting Line Terminators</h3>
<blockquote>
<p>Different operating systems use different characters to
terminate lines. For example, Windows uses the CR and LF
characters, whereas Unix/Linux uses just LF.</p>
<p><I><B>REBOL does not care about line terminators.</B></I> It
will properly handle files with any standard type of line
termination.</p>
<p>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,</p>
<pre>
write %example.r read example.r
</pre>
<p>will convert the example.r file to use the correct line
terminators for the local operating system.</p>
<p>This example converts all the .r files in a directory:</p>
<pre>
foreach file load %. [
if (suffix? file) = %.r [
write file read file
]
]
</pre>
<p><I>Note: Do not use this on binary files such as program
executables, or they may be corrupted.</I></p>
</blockquote>
<h3 id="section-4.4">4.4 Script Compatibility</h3>
<blockquote>
<p>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.</p>
<p>When REBOL/Core runs, it prints its version number to the console.
You can also obtain its version with a line such as:</p>
<pre>
print system/version
</pre>
<p>You can also determine what REBOL product you are running with
the line:</p>
<pre>
print system/product
</pre>
<p>Other system information is also available. To see a full list
of system variables, type:</p>
<pre>
help system
</pre>
</blockquote>
<h2 id="section-5">5. Platform Specific Notes</h2>
<blockquote>
</blockquote>
<h3 id="section-5.1">5.1 Windows</h3>
<blockquote>
<p>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.</p>
<p>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.</p>
<p>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.</p>
</blockquote>
<h3 id="section-5.2">5.2 Mac OS X</h3>
<blockquote>
<p>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.</p>
</blockquote>
<h3 id="section-5.3">5.3 Macintosh</h3>
<blockquote>
<p>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.</p>
<p>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.</p>
<p>For example:</p>
<pre>
read/binary/custom %file [fork "resource"]
</pre>
</blockquote>
<h3 id="section-5.4">5.4 UNIX and Linux</h3>
<blockquote>
<p>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.</p>
<p>Default file permissions include read and write permissions for
the user and for the user's group, and read permissions for all
others.</p>
</blockquote>
<h3 id="section-5.5">5.5 Amiga</h3>
<blockquote>
<p>Use Amiga's Tool Types to set the REBOL icon to the REBOL
executable file.</p>
</blockquote>
<h3 id="section-5.6">5.6 BeOS</h3>
<blockquote>
<p>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.</p>
<p>Default permissions now include read and write permissions for
the user and for the user's group, and read permissions for all
others.</p>
</blockquote>
</td></tr><tr>
<tr><td><hr></td></tr>
<td align="center">
<span class="tail"><a href="http://www.rebol.com">Copyright REBOL Technologies</a> 6-Dec-2005</span>
</td></tr></table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -