

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amigaos.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tony+Wyatt</id>
	<title>AmigaOS Documentation Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amigaos.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tony+Wyatt"/>
	<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/wiki/Special:Contributions/Tony_Wyatt"/>
	<updated>2026-05-06T04:45:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=12096</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=12096"/>
		<updated>2021-10-18T03:06:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Added [] around &amp;quot;digits&amp;quot; in X2D()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
CENTER( &#039;title&#039;, 20 )&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039;( 256*4, 1 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
   ARG string, length /* get arguments */&lt;br /&gt;
   length = MIN( length, 60 ) /* compute length */&lt;br /&gt;
RETURN &#039;CENTER&#039;( string, length )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. ([[AmigaOS_Manual:_ARexx_Functions#SETCLIP.28.29|SETCLIP()]] is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
 pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function [[AmigaOS_Manual:_ARexx_Functions#GETCLIP.28.29|GETCLIP()]] and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP( &#039;numbers&#039; )&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ABS( -5.35 ) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ABBREV( &#039;fullname&#039;, &#039;ful&#039; ) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV( &#039;almost&#039;, &#039;alm&#039;, 4 ) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV( &#039;any&#039;, &#039;&#039; ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ABS( -5.35 ) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS( 10 ) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. See also [[AmigaOS_Manual:_ARexx_Functions#REMLIB.28.29|REMLIB()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ADDLIB( &amp;quot;rexxsupport.library&amp;quot;, 0, -30, 0 ) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;, -20 /* A gateway */ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also [[AmigaOS_Manual:_ARexx_Functions#SHOW.28.29|SHOW()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the EXISTS or OMITTED keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG( 1 ) -&amp;gt; one&lt;br /&gt;
SAY ARG( 2, &#039;O&#039; ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. &#039;1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also [[AmigaOS_Manual:_ARexx_Functions#X2C.28.29|X2C()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY B2C( &#039;00110011&#039; ) -&amp;gt; 3&lt;br /&gt;
SAY B2C( &#039;01100001&#039; ) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITAND( &#039;0313&#039;x, &#039;FFF0&#039;x ) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITCHG( &#039;0313&#039;x, 4 ) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITCLR( &#039;0313&#039;x, 4 ) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITCOMP( &#039;7F&#039;x, &#039;FF&#039;x ) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP( &#039;FF&#039;x, &#039;FF&#039;x ) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITOR( &#039;0313&#039;x, &#039;00F&#039;x ) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITSET( &#039;313&#039;x, 2 ) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITTST( &#039;0313&#039;x, 4 ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
BITXOR( &#039;0313&#039;x, &#039;001F&#039;x ) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also [[AmigaOS_Manual:_ARexx_Functions#C2X.28.29|C2X()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY C2B( &#039;abc&#039; ) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY C2D( &#039;0020&#039;x ) -&amp;gt; 32&lt;br /&gt;
SAY C2D( &#039;FFFF ffff&#039;x ) -&amp;gt; -1&lt;br /&gt;
SAY C2D( &#039;FF0100&#039;x, 2 ) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also [[AmigaOS_Manual:_ARexx_Functions#C2B.28.29|C2B()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY C2X( &#039;abc&#039; ) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY CENTER( &#039;abc&#039;, 6 ) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER( &#039;abc&#039;, 6, &#039;+&#039; ) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER( &#039;123456&#039;, 3 ) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY CLOSE( &#039;input&#039; ) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the first position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COMPARE( &#039;abcde&#039;, &#039;abcce&#039; ) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE( &#039;abcde&#039;, &#039;abcde&#039; ) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE( &#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039; ) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COMPRESS( &#039; why not &#039; ) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS( &#039;++12-34-+&#039;, &#039;+-&#039; ) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COPIES( &#039;abc&#039;, 3 ) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
D2C( 65 ) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
D2X( 31 ) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lower case alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lower case characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts upper case alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digit strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY DATATYPE( &#039;123&#039; ) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE( &#039;1a f2&#039;, &#039;X&#039; ) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE( &#039;aBcde&#039;, &#039;L&#039; ) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (&#039;NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() function also accepts optional second and third arguments to supply the date either in the form of internal system days or in the &#039;sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either &#039;I&#039; or &#039;S&#039;. The current date in system days can be retrieved using DATE(&#039;INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE( &#039;M&#039; ) -&amp;gt; July&lt;br /&gt;
SAY DATE( S ) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE( &#039;S&#039;, DATE( &#039;I&#039; ) + 21 ) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE( &#039;W&#039;, 19890609, &#039;S&#039; ) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY DELSTR( &#039;123456&#039;, 2, 3 ) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY DELWORD( &#039;Tell me a story&#039;, 2, 2 ) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD( &#039;one two three&#039;, 3 ) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY EOF( infile ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ERRORTEXT( 41 ) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY EXISTS( &#039;SYS:C/ED&#039; ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also [[AmigaOS_Manual:_ARexx_Functions#IMPORT.28.29|IMPORT()]] and [[AmigaOS_Manual:_ARexx_Functions#STORAGE.28.29|STORAGE()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
count = EXPORT( &#039;0004 0000&#039;x, &#039;The answer&#039; ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FIND( &#039;Now is the time&#039;, &#039;is the&#039; ) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also [[AmigaOS_Manual:_ARexx_Functions#GETSPACE.28.29|GETSPACE()]].&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
FREESPACE( &#039;00042000&#039;x, 32 ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current [[AmigaOS_Manual:_ARexx_Instructions#NUMERIC|NUMERIC FUZZ]] setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also [[AmigaOS_Manual:_ARexx_Functions#SHOW.28.29|SHOW()]] and [[AmigaOS_Manual:_ARexx_Functions#SETCLIP.28.29|SETCLIP()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP( &#039;numbers&#039; ) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also [[AmigaOS_Manual:_ARexx_Functions#FREESPACE.28.29|FREESPACE()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY C2X( GETSPACE( 32 ) ) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY HASH( &#039;1&#039; ) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also [[AmigaOS_Manual:_ARexx_Functions#EXPORT.28.29|EXPORT()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
extval = IMPORT( &#039;0004 0000&#039;x, 8 ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY INDEX( &amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot; ) -&amp;gt; 2&lt;br /&gt;
SAY INDEX( &amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot; ) -&amp;gt; 0&lt;br /&gt;
SAY INDEX( &amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;, 3 ) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY INSERT( &#039;ab&#039;, &#039;12345&#039; ) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT( &#039;123&#039;, &#039;++&#039;, 3, 5, &#039;-&#039; ) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LASTPOS( &#039;2&#039;, &#039;1234&#039; ) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS( &#039;2&#039;, &#039;1234234&#039; ) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS( &#039;2&#039;, &#039;123234&#039;, 3 ) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS( &#039;2&#039;, &#039;13579&#039; ) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LEFT( &#039;123456&#039;, 3 ) -&amp;gt; 123&lt;br /&gt;
SAY LEFT( &#039;123456&#039;, 8, &#039;+&#039; ) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LENGTH( &#039;three&#039; ) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a [http://wiki.amigaos.net/amiga/autodocs/dos.doc.txt dos library&#039;s] &#039;&#039;&#039;WaitForChar()&#039;&#039;&#039; call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES( STDIN ) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY MAX( 2.1, 3, -1 ) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY MIN( 2.1, 3, -1 ) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The &#039;&#039;file&#039;&#039; argument defines the logical name by which the file will be referenced. STDIN and STDOUT are logical files that are available by default. The &#039;&#039;filename&#039;&#039; is the external name of the file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also [[AmigaOS_Manual:_ARexx_Functions#CLOSE.28.29|CLOSE()]], [[AmigaOS_Manual:_ARexx_Functions#READCH.28.29|READCH()]], [[AmigaOS_Manual:_ARexx_Functions#READLN.28.29|READLN()]], [[AmigaOS_Manual:_ARexx_Functions#WRITECH.28.29|WRITECH()]], and [[AmigaOS_Manual:_ARexx_Functions#WRITELN.28.29|WRITELN()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY OPEN( &#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039; ) -&amp;gt; 1&lt;br /&gt;
SAY OPEN( &#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039; ) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY OVERLAY( &#039;bb&#039;, &#039;abcd&#039; ) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY( &#039;4&#039;, &#039;123&#039;, 5, 5, &#039;-&#039; ) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(&#039;D&#039;) is equivalent to PRAGMA(&#039;D&#039;,&amp;quot;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY PRAGMA( &#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA( &#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA( &#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA( &#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;, STDOUT&lt;br /&gt;
SAY PRAGMA( &amp;quot;STACK&amp;quot;, 8092 ) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also [[AmigaOS_Manual:_ARexx_Functions#RANDU.28.29|RANDU()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
thisroll = RANDOM( 1, 6 ) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM( 1, 6 ) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also [[AmigaOS_Manual:_ARexx_Functions#RANDOM.28.29|RANDOM()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU() /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also [[AmigaOS_Manual:_ARexx_Functions#READLN.28.29|READLN()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
instring = READCH( &#039;input&#039;, 10 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also [[AmigaOS_Manual:_ARexx_Functions#READCH.28.29|READCH()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
instring = READLN( &#039;MyFile&#039; ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also [[AmigaOS_Manual:_ARexx_Functions#ADDLIB.28.29|ADDLIB()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY REMLIB( &#039;MyLibrary.library&#039; ) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY REVERSE( &#039;?ton yhw&#039; ) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY RIGHT( &#039;123456&#039;, 4 ) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT( &#039;123456&#039;, 8, &#039;+&#039; ) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEGIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SEEK( &#039;input&#039;, 10, &#039;B&#039; ) -&amp;gt; 10&lt;br /&gt;
SAY SEEK( &#039;input&#039;, 0, &#039;E&#039; ) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. See also [[AmigaOS_Manual:_ARexx_Functions#GETCLIP.28.29|GETCLIP()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SETCLIP( &#039;path&#039;, &#039;DF0:s&#039; ) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP( &#039;path&#039; ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SIGN( 12 ) -&amp;gt; 1&lt;br /&gt;
SAY SIGN( -33 ) -&amp;gt; -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE( 1 ) -&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SPACE( &#039;Now is the time&#039;, 3 ) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE( &#039;Now is the time&#039;, 0 ) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE( &#039;1 2 3&#039;, 1, &#039;+&#039; ) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied and defaults to the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also [[AmigaOS_Manual:_ARexx_Functions#EXPORT.28.29|EXPORT()]].&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039;248400&#039;&lt;br /&gt;
oldval = STORAGE( &#039;0004 0000&#039;x, &#039;The answer&#039; )&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x, , 32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{&#039;B&#039; | &#039;L&#039; | &#039;T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY STRIP( &#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP( &#039; say what? &#039;, &#039;L&#039; ) -&amp;gt; &#039;say what?&#039;&lt;br /&gt;
SAY STRIP( &#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039; ) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SUBSTR( &#039;123456&#039;, 4, 2 ) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR( &#039;myname&#039;, 3, 6, &#039;=&#039; ) -&amp;gt; &#039;name==&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SUBWORD( &#039;Now is the time &#039;, 2, 2 ) -&amp;gt; &#039;is the&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol has been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SYMBOL( &#039;J&#039; ) -&amp;gt; &#039;VAR&#039;&lt;br /&gt;
SAY SYMBOL( &#039;x&#039; ) -&amp;gt; &#039;LIT&#039;&lt;br /&gt;
SAY SYMBOL( &#039;++&#039; ) -&amp;gt; &#039;BAD&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME( &#039;C&#039; ) -&amp;gt; &#039;1:02 AM&#039;&lt;br /&gt;
SAY TIME( &#039;HOURS&#039; ) -&amp;gt; 1&lt;br /&gt;
SAY TIME( &#039;M&#039; ) -&amp;gt; 62&lt;br /&gt;
SAY TIME( &#039;N&#039; ) -&amp;gt; &#039;01:02:54&#039;&lt;br /&gt;
SAY TIME( &#039;S&#039; ) -&amp;gt; 3720&lt;br /&gt;
call TIME( &#039;R&#039; ) /*reset timer*/&lt;br /&gt;
SAY TIME( &#039;E&#039; ) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; &#039;01:02:00&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see [[AmigaOS Manual: ARexx Debugging|Chapter 6. Debugging]]) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ALL*/&lt;br /&gt;
SAY TRACE( &#039;Results&#039; ) -&amp;gt; A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to upper case. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always of the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY TRANSLATE( &amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot; ) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE( &amp;quot;low&amp;quot; ) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE( &amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot; ) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LENGTH( TRIM( &#039; abc &#039; ) ) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY TRUNC( 123.456 ) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC( 123.456, 4 ) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to upper case. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY UPPER( &#039;One Fine Day&#039; ) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE( &#039;j&#039; ) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters is in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY VERIFY( &#039;123456&#039;, &#039;0123456789&#039; ) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY( &#039;123a56&#039;, &#039;0123456789&#039; ) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY( &#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039; ) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WORD( &#039;Now is the time &#039;, 2 ) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WORDINDEX( &#039;Now is the time &#039;, 3 ) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WORDLENGTH( &#039;one two three&#039;, 3 ) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WORDS( &amp;quot;You don&#039;t SAY!&amp;quot; ) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WRITECH( &#039;output&#039;, &#039;Testing&#039; ) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY WRITELN( &#039;output&#039;, &#039;Testing&#039; ) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY X2C( &#039;12ab&#039; ) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C( &#039;12 ab&#039; ) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C( 61 ) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY X2D( &#039;1f&#039; ) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE( &#039;a&#039;, &#039;f&#039; ) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE( , &#039;0A&#039;x ) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP( &amp;quot; every good boy does fine &amp;quot; )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP( &amp;quot; every good boy does fine&amp;quot;, , &amp;quot;e&amp;quot; )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP( &amp;quot;every good boy does fine&amp;quot;, , &amp;quot;e&amp;quot; )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP( &amp;quot; every good boy does fine &amp;quot;, , &amp;quot; e&amp;quot; )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP( teststring1, T )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP( teststring1, T, &amp;quot; e&amp;quot; )&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS( teststring1 )&lt;br /&gt;
&lt;br /&gt;
CALL TIME( &#039;r&#039; )&lt;br /&gt;
SAY TIME( &#039;Civil&#039; ) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME( &#039;h&#039; ) /*Hours since midnight*/&lt;br /&gt;
SAY TIME( &#039;m&#039; ) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME( &#039;s&#039; ) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME( &#039;e&#039; ) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE( TRACE() ) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE( &#039;aBCdef&#039; ) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE( &#039;abcdef&#039;, &#039;1234&#039; )&lt;br /&gt;
SAY TRANSLATE( &#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039; )&lt;br /&gt;
SAY TRANSLATE( &#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM( &#039; abc &#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC( 123.456 )&lt;br /&gt;
SAY &#039;$&#039;TRUNC( 134566.123, 2 )&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER( &#039;aBCdef12&#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE( &#039;abc&#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY( &#039;123a45&#039;, &#039;0123456789&#039; )&lt;br /&gt;
SAY VERIFY( &#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: WORD(string,n)*/&lt;br /&gt;
SAY WORD( &#039;Now is the time&#039;, 3 )&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX( &#039;Now is the time &#039;, 3 )&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH( &#039;Now is the time &#039;, 4 )&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS( &#039;Now is the time&#039; )&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN( &#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039; ) THEN DO&lt;br /&gt;
   SAY WRITECH( &#039;test&#039;, &#039;message&#039; ) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN( &#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039; ) THEN DO&lt;br /&gt;
   SAY WRITELN( &#039;test&#039;, &#039;message&#039; )&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C( &#039;616263&#039; ) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X( XRANGE( &#039;f0&#039;x ) )&lt;br /&gt;
SAY XRANGE( &#039;a&#039;, &#039;g&#039; )&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
  every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
  every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
  every good boy does fine.&lt;br /&gt;
  every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
    abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW( &#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot; ) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB( &#039;rexxsupport.library&#039;, 0, -30, 0 )&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also [[AmigaOS_Manual:_ARexx_Functions#FREEMEM.28.29|FREEMEM()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY C2X( ALLOCMEM( 1000 ) ) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X( ALLOCMEM( 1000, &#039;00 01 00 0 1&#039;X ) ) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also [[AmigaOS_Manual:_ARexx_Functions#OPENPORT.28.29|OPENPORT()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also [[AmigaOS_Manual:_ARexx_Functions#ALLOCMEM.28.29|ALLOCMEM()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM( MemoryRequest )&lt;br /&gt;
SAY C2X( MyMem ) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM( MyMem, MemoryRequest ) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM( &#039;07C987B0&#039;x, 1024 )*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
command = GETARG( packet )&lt;br /&gt;
function = GETARG( packet, 0 ) /*name string*/&lt;br /&gt;
arg1 = GETARG( packet, 1 ) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also [[AmigaOS_Manual:_ARexx_Functions#WAITPKT.28.29|WAITPKT()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
packet = GETPKT( &#039;MyPort&#039; ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also [[AmigaOS_Manual:_ARexx_Functions#CLOSEPORT.28.29|CLOSEPORT()]]. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
success = OPENPORT( &amp;quot;MyPort&amp;quot; ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
CALL REPLY( packet, 10 ) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SHOWDIR( &#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039; ) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({&#039;A&#039; | &#039;D&#039; | &#039;H&#039; | &#039;T&#039; | &#039;L&#039; | &#039;M&#039; | &#039;P&#039; | &#039;R&#039; | &#039;S&#039; | &#039;T&#039; | &#039;V&#039; | &#039;W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SHOWLIST( &#039;P&#039; ) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST( &#039;P&#039;, , &#039;;&#039; ) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST( &#039;P&#039;, &#039;REXX&#039; ) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY STATEF( &amp;quot;LIBS:REXXSupport.library&amp;quot; )&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= REXXMathLib.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXMathLib.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 15. OpenRexxMathLibLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/* Add rexxmathlib.library, if it isn&#039;t already added. */&lt;br /&gt;
library = &#039;rexxmathlib.library&#039;&lt;br /&gt;
IF ~SHOW( &#039;L&#039;, library ) THEN DO&lt;br /&gt;
   IF ~ADDLIB( library, 0, -30, 0 ) THEN DO&lt;br /&gt;
      SAY &#039;Failed to add library &#039; || library || &#039;.&#039;&lt;br /&gt;
      EXIT 10&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ACOS() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ACOS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse cosine of the argument &#039;&#039;number&#039;&#039; in radiants. The valid number is between -1.0 and 1.0.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ACOS( 0.3 ) -&amp;gt; 1.266103672779499&lt;br /&gt;
SAY ACOS( -0.162 ) -&amp;gt; 1.733513416182851&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ACOSH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ACOSH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse hyperbolic cosine of the argument &#039;&#039;number&#039;&#039;. The valid number is &amp;gt;= 1.0. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ACOSH( 1.0 ) -&amp;gt; 1.734723475976807E-18&lt;br /&gt;
SAY ACOSH( 438756.328746 ) -&amp;gt; 13.68484665870913&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ASIN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ASIN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse sine of the argument &#039;&#039;number&#039;&#039; in radiants. The valid number is between -1.0 and 1.0. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ASIN( -1 ) -&amp;gt; -1.570796326794897&lt;br /&gt;
SAY ASIN( 0.95 ) -&amp;gt; 1.253235897503375&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ASINH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ASINH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse hyperbolic sine of the supplied argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ASINH( 123.012 ) -&amp;gt; 5.50544561307145&lt;br /&gt;
SAY ASINH( -143 ) -&amp;gt; -5.656004036134436&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ATAN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ATAN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse tangent of the supplied argument. The result is in radiants.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ATAN( -21.0083 ) -&amp;gt; -3.738630743180481&lt;br /&gt;
SAY ATAN( 0.0001 ) -&amp;gt; 9.999999983308343E-5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ATAN2() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ATAN2(y,x)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the angle between the point [y,x] and the origin in radiants. Note that the coordinate [0,0] is invalid and will result an error.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ATAN2( 3.0, 3.5 ) -&amp;gt; 0.7086262721276703&lt;br /&gt;
SAY ATAN2( 0, 0.1 ) -&amp;gt; 0&lt;br /&gt;
SAY ATAN2( -13.2, 0 ) -&amp;gt; -1.570796326794897&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ATANH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ATANH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the inverse hyperbolic tangent of the argument &#039;&#039;number&#039;&#039;. The valid number is greater than -1.0 and less than 1.0. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ATANH( -0.999 ) -&amp;gt; -0.7611738616605497&lt;br /&gt;
SAY ATANH( 0.75 ) -&amp;gt; 0.6351489523872721&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CEIL() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CEIL(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lowest integer higher than the supplied argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY CEIL( -15.999 ) -&amp;gt; -15&lt;br /&gt;
SAY CEIL( 31.4679 ) -&amp;gt; 32&lt;br /&gt;
SAY CEIL( 4.5 ) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== COS() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the cosine of the argument &#039;&#039;number&#039;&#039;. The result is in radiants. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COS( 45.3 ) -&amp;gt; 0.250400079038432&lt;br /&gt;
SAY COS( -90 ) -&amp;gt; -0.4480736161291653&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== COSEC() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COSEC(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the cosecans of the argument &#039;&#039;number&#039;&#039;. Argument value 0 is invalid.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COSEC( 1.11 ) -&amp;gt; 1.116446876597528&lt;br /&gt;
SAY COSEC( -0.1 ) -&amp;gt; -10.01668613163478&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#CSC.28.29|CSC()]]&lt;br /&gt;
&lt;br /&gt;
== CSC() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CSC(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the cosecans of the argument &#039;&#039;number&#039;&#039;. Argument value 0 is invalid.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COSEC( 1.11 ) -&amp;gt; 1.116446876597528&lt;br /&gt;
SAY COSEC( -0.1 ) -&amp;gt; -10.01668613163478&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#COSEC.28.29|COSEC()]]&lt;br /&gt;
&lt;br /&gt;
== COSH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COSH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the hyperbolic cosine of the argument &#039;&#039;number&#039;&#039;. The valid argument is between -709 and 709. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COSH( -709 ) -&amp;gt; 1.701411733192644E+38&lt;br /&gt;
SAY COSH( -5.14 ) -&amp;gt; 85.34667884485665&lt;br /&gt;
SAY COSH( 0 ) -&amp;gt; 1&lt;br /&gt;
SAY COSH( 5.14 ) -&amp;gt; 85.36081289447829&lt;br /&gt;
SAY COSH( 709 ) -&amp;gt; 4.109203730776653E+307&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== COT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the hyperbolic cotangent of the argument &#039;&#039;number&#039;&#039; in radiants. Argument value 0 is invalid.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COT( -31 ) -&amp;gt; 2.264002793782034&lt;br /&gt;
SAY COT( 12.7 ) -&amp;gt; 7.438787706407688&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#COTAN.28.29|COTAN()]]&lt;br /&gt;
&lt;br /&gt;
== COTAN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COTAN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the hyperbolic cotangent of the argument &#039;&#039;number&#039;&#039; in radiants. Argument value 0 is invalid.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY COT( -31 ) -&amp;gt; 2.264002793782034&lt;br /&gt;
SAY COT( 12.7 ) -&amp;gt; 7.438787706407688&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#COT.28.29|COT()]]&lt;br /&gt;
&lt;br /&gt;
== DEG() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DEG(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts degrees in radiants. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY DEG( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY DEG( -3.55 ) -&amp;gt; -0.06195918844579868&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== E() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;E()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of E, the base of the natural logarithm.&lt;br /&gt;
&lt;br /&gt;
== EPSM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EPSM(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the highest floating point number lower than and distinguishable from the argument &#039;&#039;number&#039;&#039;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY EPSM( -15 ) -&amp;gt; -15&lt;br /&gt;
SAY EPSM( 31.4679 ) -&amp;gt; 31.4679&lt;br /&gt;
SAY EPSM( 4 ) -&amp;gt; 3.999999999999999&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EPSP() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EPSP(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the lowest floating point number higher than and distinguishable from the argument &#039;&#039;number&#039;&#039;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY EPSP( -15 ) -&amp;gt; -15&lt;br /&gt;
SAY EPSP( 31.4679 ) -&amp;gt; 31.4679&lt;br /&gt;
SAY EPSP( 4 ) -&amp;gt; 4.000000000000001&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EXP() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXP(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the exponential of the argument &#039;&#039;number&#039;&#039;. The valid argument is equal or less than 709. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY EXP( -709 ) -&amp;gt; 1.216780750623518E-308&lt;br /&gt;
SAY EXP( 1.76 ) -&amp;gt; 5.812437394401813&lt;br /&gt;
SAY EXP( 709 ) -&amp;gt; 8.218407461553307E+307&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FABS() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the &#039;&#039;number&#039;&#039; argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FABS( -5.35 ) -&amp;gt; 5.35&lt;br /&gt;
SAY FABS( 10 ) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FACT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FACT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the factorial of the &#039;&#039;number&#039;&#039; argument. The supplied value must be integer between 0 and 87. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FACT( 0 ) -&amp;gt; 1&lt;br /&gt;
SAY FACT( 21 ) -&amp;gt; 5.109094217170944E+19&lt;br /&gt;
SAY FACT( 87 ) -&amp;gt; 2.107757298379517E+132&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FLOOR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FLOOR(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the highest integer lower than the &#039;&#039;number&#039;&#039; argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FLOOR( -15.999 ) -&amp;gt; -16&lt;br /&gt;
SAY FLOOR( 31.4679 ) -&amp;gt; 31&lt;br /&gt;
SAY FLOOR( 4.5 ) -&amp;gt; 4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#INT.28.29|INT()]]&lt;br /&gt;
&lt;br /&gt;
== FRACT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FRACT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the fractional part of the &#039;&#039;number&#039;&#039; argument. For examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FRACT( 63.003 ) -&amp;gt; &lt;br /&gt;
SAY FRACT( 0.0829 ) -&amp;gt; &lt;br /&gt;
SAY FRACT( -17.63 ) -&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the highest integer lower than the &#039;&#039;number&#039;&#039; argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY FLOOR( -15.999 ) -&amp;gt; -16&lt;br /&gt;
SAY FLOOR( 31.4679 ) -&amp;gt; 31&lt;br /&gt;
SAY FLOOR( 4.5 ) -&amp;gt; 4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#FLOOR.28.29|FLOOR()]]&lt;br /&gt;
&lt;br /&gt;
== LN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the natural logarithm of the &#039;&#039;number&#039;&#039; argument. The supplied argument must be greater than 0. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LOG( 0.0001 ) -&amp;gt; -9.21034037197618&lt;br /&gt;
SAY LOG( 104.8 ) -&amp;gt; 4.652053771886941&lt;br /&gt;
SAY LOG( 2730.3 ) -&amp;gt; 7.912166772251418&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#LOG.28.29|LOG()]]&lt;br /&gt;
&lt;br /&gt;
== LOG() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LOG(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the natural logarithm of the &#039;&#039;number&#039;&#039; argument. The supplied argument must be greater than zero. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LOG( 0.0001 ) -&amp;gt; -9.21034037197618&lt;br /&gt;
SAY LOG( 104.8 ) -&amp;gt; 4.652053771886941&lt;br /&gt;
SAY LOG( 2730.3 ) -&amp;gt; 7.912166772251418&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#LN.28.29|LN()]]&lt;br /&gt;
&lt;br /&gt;
== LOG10() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LOG10(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the decadic logarithm of the &#039;&#039;number&#039;&#039; argument. The supplied argument must be greater than 0. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY LOG( 0.0001 ) -&amp;gt; -3.999999999999998&lt;br /&gt;
SAY LOG( 104.8 ) -&amp;gt; 2.020361282647707&lt;br /&gt;
SAY LOG( 2730.3 ) -&amp;gt; 3.436210369087053&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NINT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NINT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nearest integer to the &#039;&#039;number&#039;&#039; argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY NINT( -15.999 ) -&amp;gt; -16&lt;br /&gt;
SAY NINT( 31.4679 ) -&amp;gt; 31&lt;br /&gt;
SAY NINT( 4.5 ) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PI() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PI()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of PI.&lt;br /&gt;
&lt;br /&gt;
== POL() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POL(x,y)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the angle between the point [x,y] and the origin in radiants. Note that the coordinate [0,0] is invalid and will result an error.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY POL( 3.5, 3.0 ) -&amp;gt; 0.7086262721276703&lt;br /&gt;
SAY POL( 0.1, 0 ) -&amp;gt; 0&lt;br /&gt;
SAY POL( 0, -13.2 ) -&amp;gt; -1.570796326794897&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== POW() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POW(base,exponent)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of a number (&#039;&#039;base&#039;&#039;) raised to another (&#039;&#039;exponent&#039;&#039;). You can use positive or negative integers, or positive floating point numbers. When using integers, both base and exponent cannot be zeros at the same time. In addition exponent cannot be less than 1, if base is 0. If you use floating point numbers, base and exponent can be zeros at the same time.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY POW( 2, 0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( -93, 2 ) -&amp;gt; 8649 &lt;br /&gt;
SAY POW( 93, -2 ) -&amp;gt; 1.156203029251937E-4&lt;br /&gt;
SAY POW( 0, 1 ) -&amp;gt; 0&lt;br /&gt;
SAY POW( 0.0, 0.0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( 3.0, 0.3 ) -&amp;gt; 1.39038917031567&lt;br /&gt;
SAY POW( 1.23, -8 ) -&amp;gt; 0.1908794207865751&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#POWER.28.29|POWER()]]&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#XTOY.28.29|XTOY()]]&lt;br /&gt;
&lt;br /&gt;
== POWER() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POWER(base,exponent)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of a number (&#039;&#039;base&#039;&#039;) raised to another (&#039;&#039;exponent&#039;&#039;). You can use positive or negative integers, or positive floating point numbers. When using integers, both base and exponent cannot be zeros at the same time. In addition exponent cannot be less than 1, if base is 0. If you use floating point numbers, base and exponent can be zeros at the same time.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY POW( 2, 0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( -93, 2 ) -&amp;gt; 8649 &lt;br /&gt;
SAY POW( 93, -2 ) -&amp;gt; 1.156203029251937E-4&lt;br /&gt;
SAY POW( 0, 1 ) -&amp;gt; 0&lt;br /&gt;
SAY POW( 0.0, 0.0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( 3.0, 0.3 ) -&amp;gt; 1.39038917031567&lt;br /&gt;
SAY POW( 1.23, -8 ) -&amp;gt; 0.1908794207865751&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#POW.28.29|POW()]]&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#XTOY.28.29|XTOY()]]&lt;br /&gt;
&lt;br /&gt;
== RAD() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RAD(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts radiants in degrees. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY RAD( 0.3 ) -&amp;gt; 17.1887338539247&lt;br /&gt;
SAY RAD( -1.35 ) -&amp;gt; -77.34930234266113&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ROOT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ROOT(x,y)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the y-th root of x. &lt;br /&gt;
&lt;br /&gt;
The following rules apply:&lt;br /&gt;
* When y is a floating point number, x must be a positive number or zero.&lt;br /&gt;
* When y is a non-zero odd integer number, x can be a positive or negative number.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY ROOT( 1, 2.0 ) -&amp;gt; 0.999999999999999&lt;br /&gt;
SAY ROOT( -27, 3) -&amp;gt; -2,999999999999451&lt;br /&gt;
SAY ROOT( 0, 1 ) -&amp;gt; 0&lt;br /&gt;
SAY ROOT( 4, 2 ) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SEC() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEC(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the secans of the &#039;&#039;number&#039;&#039; argument. The result is in radiants.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SEC( 20 ) -&amp;gt; 2.4504875209567&lt;br /&gt;
SAY SEC( -33.01 ) -&amp;gt; -42.9644890047367&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SIN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the sine of the &#039;&#039;number&#039;&#039; argument. The result is in radiants. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SIN( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY SIN( 270 ) -&amp;gt; -0.176045946471159&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SINH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SINH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the hyperbolic sine of the &#039;&#039;number&#039;&#039; argument. The valid argument is between -709 and 709. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SINH( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY SINH( 90 ) -&amp;gt; 6.102016471587611E+38&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SQR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SQR(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the square root of the &#039;&#039;number&#039;&#039; argument. The supplied argument must be a positive number or zero. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SQR( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY SQR( 9 ) -&amp;gt; 3&lt;br /&gt;
SAY SQR( 256 ) -&amp;gt; 16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#SQRT.28.29|SQRT()]]&lt;br /&gt;
&lt;br /&gt;
== SQRT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SQRT(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the square root of the &#039;&#039;number&#039;&#039; argument. The supplied argument must be a positive number or zero. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY SQR( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY SQR( 9 ) -&amp;gt; 3&lt;br /&gt;
SAY SQR( 256 ) -&amp;gt; 16&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#SQR.28.29|SQR()]]&lt;br /&gt;
&lt;br /&gt;
== TAN() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TAN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the tangent of the &#039;&#039;number&#039;&#039; argument. The result is in radiants. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY TAN( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY TAN( 270 ) -&amp;gt; -0.178839063798397&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== TANH() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TANH(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculates the hyperbolic tangent of the &#039;&#039;number&#039;&#039; argument. The result is in radiants. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY TANH( 0 ) -&amp;gt; 0&lt;br /&gt;
SAY TANH( 270 ) -&amp;gt; 0.999999999999998 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XTOY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XTOY(base,exponent)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of a number (&#039;&#039;base&#039;&#039;) raised to another (&#039;&#039;exponent&#039;&#039;). You can use positive or negative integers, or positive floating point numbers. When using integers, both base and exponent cannot be zeros at the same time. In addition exponent cannot be less than 1, if base is 0. If you use floating point numbers, base and exponent can be zeros at the same time.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
SAY POW( 2, 0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( -93, 2 ) -&amp;gt; 8649 &lt;br /&gt;
SAY POW( 93, -2 ) -&amp;gt; 1.156203029251937E-4&lt;br /&gt;
SAY POW( 0, 1 ) -&amp;gt; 0&lt;br /&gt;
SAY POW( 0.0, 0.0 ) -&amp;gt; 1&lt;br /&gt;
SAY POW( 3.0, 0.3 ) -&amp;gt; 1.39038917031567&lt;br /&gt;
SAY POW( 1.23, -8 ) -&amp;gt; 0.1908794207865751&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function aliases:&lt;br /&gt;
&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#POW.28.29|POW()]]&lt;br /&gt;
* [[AmigaOS_Manual:_ARexx_Functions#POWER.28.29|POWER()]]&lt;br /&gt;
&lt;br /&gt;
= Notification Function Host Commands =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the commands supported by Notification. Notification is an [[Application_Library|application library]] feature for displaying application alerts and notifications for the user. Messages show up on the Workbench screen in boxes which fade away after a time or which should be closed by the user.&lt;br /&gt;
&lt;br /&gt;
Before sending commands host address must be set to Notication&#039;s message port (NOTIFYA). Below is an example that shows you how to set the host address.&lt;br /&gt;
&lt;br /&gt;
== Program 16. SetHostAddress.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;rexx&amp;quot;&amp;gt;&lt;br /&gt;
/* Set host address */&lt;br /&gt;
port = &#039;NOTIFYA&#039;&lt;br /&gt;
IF ~SHOW( &#039;P&#039;, port ) THEN DO&lt;br /&gt;
   SAY &#039;Notification system is not available.&#039;&lt;br /&gt;
   EXIT 10&lt;br /&gt;
END&lt;br /&gt;
ADDRESS VALUE port&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NOTIFY ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NOTIFY APP/K/A,UPDATE/S,CLOSEONDC/S,PRI/K,SCREEN/K,IMG/K,IMGVALIGN/K/N,LOGONLY/S,TITLE/K,SOUND/K,BACKRXMSG/K,AREXXPORT/K,TEXT/F&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REGISTERAPP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REGISTERAPP APP/K/A,UPDATE/S,IMG/K,ICON/K,TITLE/K,SOUND/K,TEXT/F&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UNREGISTERAPP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UNREGISTERAPP APP/K/A&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_AmigaDOS_Additional_Amiga_Directories&amp;diff=9240</id>
		<title>AmigaOS Manual: AmigaDOS Additional Amiga Directories</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_AmigaDOS_Additional_Amiga_Directories&amp;diff=9240"/>
		<updated>2017-10-02T21:55:47Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed wrong ENV: description.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In addition to the AmigaDOS commands, there are other files and directories on your Workbench disk. This chapter includes the following:&lt;br /&gt;
&lt;br /&gt;
* DEVS:&lt;br /&gt;
* S:&lt;br /&gt;
* L:&lt;br /&gt;
* FONTS:&lt;br /&gt;
* LIBS:&lt;br /&gt;
* REXX:&lt;br /&gt;
* LOCALE:&lt;br /&gt;
* ENVARC:&lt;br /&gt;
* ENV:&lt;br /&gt;
* CLIPS:&lt;br /&gt;
* T:&lt;br /&gt;
* Classes&lt;br /&gt;
* C:&lt;br /&gt;
&lt;br /&gt;
The drawers contained in DEVS: are described in the Workbench User&#039;s Guide .&lt;br /&gt;
&lt;br /&gt;
You do not need a detailed understanding of the contents of the directories listed here. Unless specifically directed otherwise, you can safely ignore them. However, you should know their purposes and locations in case you inadvertently delete or rename a file in a directory or need to copy something to the appropriate directory.&lt;br /&gt;
&lt;br /&gt;
Figure B-1 illustrates the standard directory structure of a hard disk Amiga system. Directories with icons visible from Workbench (drawers) are shown on the left; other directories are on the right. The standard contents and structure of these directories may change as the AmigaOS development team adds, changes, or removes resources.&lt;br /&gt;
&lt;br /&gt;
[[File:DosFigB-1.png|center|frame|System Directory Tree]]&lt;br /&gt;
&lt;br /&gt;
Most of these directories are automatically assigned to the SYS: volume or to the Ram Disk. These directories, as well as SYS:, can be ASSIGNed to different volume when necessary.&lt;br /&gt;
&lt;br /&gt;
For example, you can assign FONTS: to a particular disk, such as FontDisk:. Most applications automatically look for the fonts that they need in the FONTS: directory, regardless of where that is. By changing the FONTS: assignment, you can allow applications to use the fonts on FontDisk:&lt;br /&gt;
&lt;br /&gt;
= DEVS: =&lt;br /&gt;
&lt;br /&gt;
In addition to the DOSDrivers, Keymaps, Printers, Monitors, and DataTypes drawers described in the Workbench User&#039;s Guide, the DEVS: drawer contains files and subdirectories that pertain to the devices that can be used with the Amiga.&lt;br /&gt;
&lt;br /&gt;
Note that you can refer to the DEVS:Keymaps and DEVS:Printers drawers by their assigned names KEYMAPS: and PRINTERS:, respectively.&lt;br /&gt;
&lt;br /&gt;
== Device Files ==&lt;br /&gt;
&lt;br /&gt;
The following lists the .device files in DEVS: and their functions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| clipboard.device || Controls access to CLIPS:.&lt;br /&gt;
|-&lt;br /&gt;
| Parallel.device || Controls access to the parallel port.&lt;br /&gt;
|-&lt;br /&gt;
| printer.device || Controls access to the printer device.&lt;br /&gt;
|-&lt;br /&gt;
| Serial.device || Controls access to the serial port.&lt;br /&gt;
|-&lt;br /&gt;
| mfm.device || Controls access to MS-DOS disks with CrossDOS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For more information on the .device files, see [[Devices|Amiga Devices]].&lt;br /&gt;
&lt;br /&gt;
== Other Files ==&lt;br /&gt;
&lt;br /&gt;
The following additional files are found in DEVS:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| system-configuration || Holds certain Preferences configuration data needed when booting.&lt;br /&gt;
|-&lt;br /&gt;
| Postscript_init.ps || Holds information needed to initialize a PostScript printer when using PrinterPS.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using Mount Files or a MountList ===&lt;br /&gt;
&lt;br /&gt;
To access new devices, the Amiga must be informed when any are added. These may be physical devices, such as a tape drive, or software (logical) devices, such as a recoverable RAM disk. There are several ways to do this:&lt;br /&gt;
&lt;br /&gt;
* Placing a driver in the Expansion drawer&lt;br /&gt;
* Placing a mount file in the DOSDrivers drawer&lt;br /&gt;
* Making an entry for the device in a MountList file and using the MOUNT command&lt;br /&gt;
&lt;br /&gt;
A mount file represents a device, handler, or file system. Standard devices have their own mount file with icons in the DOSDrivers drawer in DEVS:. These are mounted automatically during the standard Startup-sequence. Alternatively, devices can use the MOUNT command to read a MountList entry that determines the characteristics of the device.&lt;br /&gt;
&lt;br /&gt;
The need to use a MountList and the MOUNT command has been eliminated by the mount file method used in Amiga system software Release 2.1 and beyond. Rather than requiring a MountList file with entries for each device you want to mount, DEVS: now contains the DOSDrivers drawer, which holds a separate mount file or DOS driver for each device. The contents of a mount file are essentially the same as an individual MountList entry.&lt;br /&gt;
&lt;br /&gt;
You can, however, continue to use a MountList to mount devices. Copy the MountList to DEVS: and remove any DOS drivers in the DOSDrivers drawers that have the same name as one of your MountList entries. (A mount file overrides a MountList entry of the same name.)&lt;br /&gt;
&lt;br /&gt;
=== Creating a MountFile or MountList Entry ===&lt;br /&gt;
&lt;br /&gt;
The following information on mount files also applies to MountLists, except as noted.&lt;br /&gt;
&lt;br /&gt;
Mount files contain keywords describing the device, handler, or file system, as well as values for those keywords. Some keywords apply only to a file system or a handler. If a keyword is omitted, a default value is used. Be sure that the default value is appropriate for the device.&lt;br /&gt;
&lt;br /&gt;
The following are rules for creating a mount file or MountList:&lt;br /&gt;
&lt;br /&gt;
* The file must be a plain ASCII text file.&lt;br /&gt;
* The mount file name must be the name of the device; the name of a MountList should be MountList.&lt;br /&gt;
* Each entry in a MountList must start with the name of the device. Omit this for a mount file.&lt;br /&gt;
* Keywords are followed by an equals sign (=).&lt;br /&gt;
* Keywords must be separated by a semicolon or be placed on separate lines.&lt;br /&gt;
* Comments are allowed in standard C style (that is, comments start with /* and end with */).&lt;br /&gt;
* Each MountList entry must end with the # symbol. Omit this for a mount file.&lt;br /&gt;
&lt;br /&gt;
When creating a new mount file or MountList entry, refer to the documentation that came with the device or start with an example of one for a similar device. Change or add only the necessary keywords.&lt;br /&gt;
&lt;br /&gt;
The following table, lists keywords and their default values supported in a mount file or MountList and their functions. Default values are shown in angle brackets.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Keyword !! Function &lt;br /&gt;
|-&lt;br /&gt;
| Handler=&amp;lt;none&amp;gt; || A handler entry (for example, Handler = L:eque-handler).&lt;br /&gt;
|-&lt;br /&gt;
| Ehandler=&amp;lt;none&amp;gt; || An environment handler entry.&lt;br /&gt;
|-&lt;br /&gt;
| FileSystem=&amp;lt;none&amp;gt; || A file system entry (for example, FileSystem = L:CrossDosFileSystem).&lt;br /&gt;
|-&lt;br /&gt;
| Device=&amp;lt;none&amp;gt; || A device entry (for example, Device = DEVS:mfm.device). This argument is required to mount a file system. There is no default value for Device; you must supply a value.&lt;br /&gt;
|-&lt;br /&gt;
| Priority=&amp;lt;10&amp;gt; || The priority of the process; 5 is good for handlers, 10 for file systems.&lt;br /&gt;
|-&lt;br /&gt;
| Unit=&amp;lt;0&amp;gt; || The unit number of the device (for example, 0 for PC0:).&lt;br /&gt;
|-&lt;br /&gt;
| Flags=&amp;lt;0&amp;gt; || Flags for OpenDevice (usually 0).&lt;br /&gt;
|-&lt;br /&gt;
| Surfaces=&amp;lt;none&amp;gt; || The number of surfaces (2 for floppy devices, varies for hard drives). This argument is required to mount a file system. There is no default value for Surfaces; you must supply a value.&lt;br /&gt;
|-&lt;br /&gt;
| SectorsPerBlock=&amp;lt;none&amp;gt; || Defines the number of physical disk sectors in each logical block used by the file system.&lt;br /&gt;
|-&lt;br /&gt;
| SectorsPerTrack=&amp;lt;none&amp;gt; || The number of blocks per track. This argument is required to mount a file system. There is no default value for SectorsPerTrack; you must supply a value.&lt;br /&gt;
|-&lt;br /&gt;
| SectorSize=&amp;lt;512&amp;gt; || Specifies the number of bytes in a block on the device. Most devices use a 512 byte block; however, some devices use other sizes (for example, CD-ROMs use 2048 bytes).&lt;br /&gt;
|-&lt;br /&gt;
| Reserved=&amp;lt;2&amp;gt; || The number of blocks reserved for the boot block; should be 2.&lt;br /&gt;
|-&lt;br /&gt;
| Interleave=&amp;lt;0&amp;gt; || Interleave value; varies with the device.&lt;br /&gt;
|-&lt;br /&gt;
| LowCyl=&amp;lt;none&amp;gt; || Starting cylinder to use. This argument is required to mount a file system. There is no default value for LowCyl; you must supply a value.&lt;br /&gt;
|-&lt;br /&gt;
| HighCyl_&amp;lt;none&amp;gt; || Ending cylinder to use. This argument is required to mount a file system. There is no default value for HighCyl; you must supply a value.&lt;br /&gt;
|-&lt;br /&gt;
| Stacksize=&amp;lt;600&amp;gt; || Amount of stack allocated to the process.&lt;br /&gt;
|-&lt;br /&gt;
| Buffers=&amp;lt;5&amp;gt; || Number of initial 512-byte cache buffers. Increase this for higher disk performance if you have RAM to spare.&lt;br /&gt;
|-&lt;br /&gt;
| BufMem Type=&amp;lt;3&amp;gt; || Memory type used for buffers; (0 and 1 = Any, 2 and 3 = Chip, 4 and 5 = Fast).&lt;br /&gt;
|-&lt;br /&gt;
| Mount=&amp;lt;0&amp;gt; || See the description of ACTIVATE, which is a synonym for MOUNT.&lt;br /&gt;
|-&lt;br /&gt;
| MaxTransfer=&amp;lt;0x7ffffff&amp;gt; || The maximum number of bytes transferred at one time with any file system. Use Max Transfer for compatibility with older hard drive systems.&lt;br /&gt;
|-&lt;br /&gt;
| Mask=&amp;lt;0xffffffff&amp;gt; || Address Mask to specify memory range that DMA transfers can use at one time with any file system. Use Mask for compatibility with older hard drive systems.&lt;br /&gt;
|-&lt;br /&gt;
| Glob Vec=&amp;lt;2&amp;gt; || A global vector for the process; -1 is no Global Vector (for C and assembler programs), 0 sets up a private GV; if the keyword is absent, the shared Global Vector is used. Omit this keyword for Amiga file system devices.&lt;br /&gt;
|-&lt;br /&gt;
| Startup=&amp;lt;none&amp;gt; || A string passed to the device, handler, or file system on startup as a BPTR to a BSTR.&lt;br /&gt;
|-&lt;br /&gt;
| Activate=&amp;lt;0&amp;gt; || If a positive value, ACTIVATE loads the device or handler immediately rather than waiting for first access. Synonymous with MOUNT.&lt;br /&gt;
|-&lt;br /&gt;
| BootPri=&amp;lt;0&amp;gt; || A value that sets the boot priority of a bootable and mountable device. This value can range from -129 to 127. By convention, -129 indicates that the device is not bootable and is not automatically mounted.&lt;br /&gt;
|-&lt;br /&gt;
| DosType=&amp;lt;0x444F5300&amp;gt; || Indicates the type of file system, giving hexadecimal ASCII codes for three letters and a concluding number as follows:&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 ! Value !! ASCII !! File System&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5300 || DOS0 || Original (OFS)&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5301 || DOS1 || FastFileSystem (FFS)&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5302 || DOS2 || International Mode OFS&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5303 || DOS3 || International Mode FFS&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5304 || DOS4 || Directory caching International Mode OFS&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x444F5305 || DOS5 || Directory caching International Mode FFS&lt;br /&gt;
 |-&lt;br /&gt;
 | 0x4D534400 || MSD0 || MS-DOS&lt;br /&gt;
 |}&lt;br /&gt;
|-&lt;br /&gt;
| Baud=&amp;lt;1200&amp;gt; || Serial device baud rate.&lt;br /&gt;
|-&lt;br /&gt;
| Control=&amp;lt;0&amp;gt; || Serial device word length, parity, and stop bits.&lt;br /&gt;
|-&lt;br /&gt;
| Forceload=&amp;lt;0&amp;gt; || Forces a file system to be loaded form disk even though a suitable entry is in the resource list. If 0 (the default), check the resource list before the disk. If 1, always load from disk.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= S: Directory =&lt;br /&gt;
&lt;br /&gt;
The S: directory is generally reserved for AmigaDOS and ARexx scripts. However, you may place non-script files in S: or place script files in other directories. In addition to the Startup-sequence file, the User-startup file that you create, and Shell-startup files, the S: directory also contains teh scripts described in this section.&lt;br /&gt;
&lt;br /&gt;
== ED-Startup ==&lt;br /&gt;
&lt;br /&gt;
This file contains ED commands used to configure the ED text editor, assigning the default function key options. Key assignments can be customized by editing this file. Removing or renaming this file activates expanded ED command menus; see Chapter 4 for instructions on how to do this.&lt;br /&gt;
&lt;br /&gt;
Other files containing ED commands can be stored in S: for use by the WITH keyword of ED, which allows ED command files to perform custom editing operations.&lt;br /&gt;
&lt;br /&gt;
== SPat, DPat ==&lt;br /&gt;
&lt;br /&gt;
These scripts allow pattern matching with commands that do not normally support it. When run with a command, SPat and DPat use the LIST command to create temporary script files in the T: directory and then execute the scripts. SPat and DPat can be used within command aliases.&lt;br /&gt;
&lt;br /&gt;
SPat adds pattern matching to single-argument commands. For example, to use ED to edit all the files in the S: directory beginning with the letter&#039;s, enter:&lt;br /&gt;
&lt;br /&gt;
 1&amp;gt; SPat ED S:s#?&lt;br /&gt;
&lt;br /&gt;
A script similiar to the following is generated:&lt;br /&gt;
&lt;br /&gt;
 ED &amp;quot;s:Shell-startup&amp;quot;&lt;br /&gt;
 ED &amp;quot;s:SPat&amp;quot;&lt;br /&gt;
 ED &amp;quot;s:Startup-sequence&amp;quot;&lt;br /&gt;
&lt;br /&gt;
SPat executes the script, invoking ED three times to display the files.&lt;br /&gt;
&lt;br /&gt;
DPat adds pattern matching to double-argument commands. After DPat and the command name, enter the two arguments separated by a space, using the wildcards required to produce the desired matches.&lt;br /&gt;
&lt;br /&gt;
== PCD ==&lt;br /&gt;
&lt;br /&gt;
Like the CD command, the PCD script changes the current directory. However, PCD also remembers the directory from which you are changing, so you can return to it without entering the entire path. Each Shell has an independent PCD memory.&lt;br /&gt;
&lt;br /&gt;
The first time you use PCD in a given Shell, you must give it the path to a directory. When entered with this path argument, PCD has the same effect as CD, changing to the named directory, but it also stores the path to the directory from which you changed. You can then change the current directory by the usual methods. To return to the initial directory, enter PCD alone. For example:&lt;br /&gt;
&lt;br /&gt;
 1.System:&amp;gt; PCD Work:Paint/24bit&lt;br /&gt;
 1.Work:Paint/24bit&amp;gt; PCD&lt;br /&gt;
 1.System:&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Subsequent invocations of PCD switch to the directory in which you last used PCD:&lt;br /&gt;
&lt;br /&gt;
 1.System:&amp;gt; PCD&lt;br /&gt;
 1.Work:Paint/24bit&amp;gt; /&lt;br /&gt;
 1.Work:Paint&amp;gt; PCD&lt;br /&gt;
 1.System:&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PCD use the assign list to store the remembered directory. When you use PCD, the list contains the assignment from&amp;lt;n&amp;gt; , where &amp;lt;n&amp;gt; is the Shell number. Using PCD with no argument before establishing the first from directory produces an error requester.&lt;br /&gt;
&lt;br /&gt;
For further examples of PCD, see Chapter 8.&lt;br /&gt;
&lt;br /&gt;
= L: Directory =&lt;br /&gt;
&lt;br /&gt;
This directory contains device handlers, which are software modules that go between AmigaDOS and the devices used by the Amiga. However, most handlers are treated as if they are actual physical devices and they are referred to by their device name.&lt;br /&gt;
&lt;br /&gt;
Handlers must be named in the mount file or MountList for their respective devices. Handlers are called and manipulated by programs, not users. New handlers can be supplied with some devices or programs and should be copied to the L: directory.&lt;br /&gt;
&lt;br /&gt;
== Aux-Handler ==&lt;br /&gt;
&lt;br /&gt;
The Aux-handler provides unbuffered serial input and output. It is essentially a console handler that uses the serial port rather than the Amiga screen and keyboard.&lt;br /&gt;
&lt;br /&gt;
The DOSDrivers mount file for AUX is:&lt;br /&gt;
&lt;br /&gt;
 Handler = L:Aux-handler&lt;br /&gt;
 Stacksize = 1000&lt;br /&gt;
 Priority = 5&lt;br /&gt;
&lt;br /&gt;
You can use Aux-Handler to use a serial terminal with your Amiga. For example:&lt;br /&gt;
&lt;br /&gt;
 1&amp;gt; NEWSHELL AUX: &lt;br /&gt;
&lt;br /&gt;
== Queue-Handler (PIPE:) ==&lt;br /&gt;
&lt;br /&gt;
The Queue-Handler is an input/output mechanism used to provide I/O communication between programs. It creates an interprocess communication channel named PIPE. For more information about PIPE:, see Appendix D.&lt;br /&gt;
&lt;br /&gt;
== Port-Handler ==&lt;br /&gt;
&lt;br /&gt;
The Port-Handler is the AmigaDOS interface for the SER:, PAR:, and PRT: devices.&lt;br /&gt;
&lt;br /&gt;
When accessing SER:, you can supply settings for the baud rate and control information. The form for this is SER:&amp;lt;baud/control&amp;gt;, where baud is a number representing the baud rate and where control is a three character sequence indicating the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| Number of read/write bits || First character; either 7 or 8&lt;br /&gt;
|-&lt;br /&gt;
| Parity || Second character; N (no parity), O (odd parity), E (even parity), M (mark parity), S (space parity)&lt;br /&gt;
|-&lt;br /&gt;
| Number of stops bits || Third character; either 1 or 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 SER:9600/8N1&lt;br /&gt;
&lt;br /&gt;
connects to the serial port, sets the baud rate to 9600 with a bit data, no parity, and one stop bit.&lt;br /&gt;
&lt;br /&gt;
If you specify no baud rate or control values when accessing SER:, the values set in the Serial Preferences editor are used.&lt;br /&gt;
&lt;br /&gt;
== CrossDOSFileSystem ==&lt;br /&gt;
&lt;br /&gt;
The CrossDOSFileSystem is required to use CrossDOS.&lt;br /&gt;
&lt;br /&gt;
== FileSystem_Trans ==&lt;br /&gt;
&lt;br /&gt;
The FileSystem_Trans directory contains the following files required for CrossDOS text translation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| DANSK.crossdos || Filters Danish text files&lt;br /&gt;
|-&lt;br /&gt;
| INTL.crossdos || Preserves international characters&lt;br /&gt;
|-&lt;br /&gt;
| MAC.crossdos || Converts Apple Macintosh ASCII files&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CDFileSystem ==&lt;br /&gt;
&lt;br /&gt;
The CDFileSystem is required to use a CD-ROM drive.&lt;br /&gt;
&lt;br /&gt;
= FONTS: =&lt;br /&gt;
&lt;br /&gt;
FONTS: is the disk or directory that contains the information for all of the different styles of fonts available to the Amiga. Font information is stored differently for bitmap and outline fonts.&lt;br /&gt;
&lt;br /&gt;
== Bitmap Fonts ==&lt;br /&gt;
&lt;br /&gt;
For each bitmap font, there is a subdirectory and a .font file. The font subdirectory contains files for the different point sizes that are available. Each of these files contains the bitmap representation of every character in the font at that point size.&lt;br /&gt;
&lt;br /&gt;
For example, for the Emerald font, there is an Emerald directory and an Emerald.font file. The Emerald directory contains two files: 17 and 20. The files contain the data needed for the 17 point Emerald font and the 20 point Emerald font, respectively. The Emerald.font file contains the list of point sizes and any available styles, such as bold and italics for the font.&lt;br /&gt;
&lt;br /&gt;
Many word processor or desktop publishing programs contain additional fonts that you should copy to your FONTS: directory. After you add new fonts to FONTS:, run the FixFonts program to create the .font file for the new additions.&lt;br /&gt;
&lt;br /&gt;
The Topaz font is the default font used by the Amiga. In addition to existing in FONTS:, Topaz 8 and Topaz 9 are built into ROM so that text can always be displayed; however only Topaz 11 is in the Topaz directory.&lt;br /&gt;
&lt;br /&gt;
== Outline Fonts ==&lt;br /&gt;
&lt;br /&gt;
The Compugraphic Intellifont outline font system used on the Amiga stores font data differently. As with the bitmap fonts, there is a .font file for each typeface. There is also a .otag file for each. The two subdirectories _bullet and _bullet_outlines contain the actual outline information for the typefaces installed on your system. You should not try to manipulate these files directly. Always use the Intellifont program or your applications&#039; font installation tools to manage outline fonts.&lt;br /&gt;
&lt;br /&gt;
= LIBS: Directory =&lt;br /&gt;
&lt;br /&gt;
LIBS: contains libraries of software routines and math functions commonly used by the operating system and applications. The files found in the LIBS: directory are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! .library File !! Function&lt;br /&gt;
|-&lt;br /&gt;
| amigaguide.library || Functions used by the AmigaGuide hypertext system.&lt;br /&gt;
|-&lt;br /&gt;
| asl.library || File, font, and screen mode requester functions.&lt;br /&gt;
|-&lt;br /&gt;
| Bullet.library || Library functions for finding and loading outline fonts.&lt;br /&gt;
|-&lt;br /&gt;
| Commodities.library || Functions used by Commodities Exchange programs.&lt;br /&gt;
|-&lt;br /&gt;
| datatypes.library || Functions for enabling manipulation ot the file types in DEVS:DataTypes.&lt;br /&gt;
|-&lt;br /&gt;
| Diskfont.library || Library functions for finding and loading font files.&lt;br /&gt;
|-&lt;br /&gt;
| iffparse.library || Functions to read IFF files.&lt;br /&gt;
|-&lt;br /&gt;
| locale.library || Functions for using localization features in the Amiga operating system.&lt;br /&gt;
|-&lt;br /&gt;
| lowlevel.library || Library to aid in game programming.&lt;br /&gt;
|-&lt;br /&gt;
| mathieeedoubbas.library || Double-precision IEEE math routine functions for basic functions (addition, subtraction, and so forth).&lt;br /&gt;
|-&lt;br /&gt;
| mathieeedoubtrans.library || Double-precision IEEE math routine functions for transcendental functions (sine, cosine, and so forth).&lt;br /&gt;
|-&lt;br /&gt;
| mathieeesingtrans.library || Fast single-precision IEEE math routine functions.&lt;br /&gt;
|-&lt;br /&gt;
| Mathtrans.library || FFP transcendental function math routine functions.&lt;br /&gt;
|-&lt;br /&gt;
| Realtime.library || Function to synchronize multimedia events, such as music and animation.&lt;br /&gt;
|-&lt;br /&gt;
| Rexxsupport.library || Functions used by ARexx.&lt;br /&gt;
|-&lt;br /&gt;
| Rexxsyslib.library || Main ARexx functions.&lt;br /&gt;
|-&lt;br /&gt;
| Version.library || Contains current software version and revision information.&lt;br /&gt;
|-&lt;br /&gt;
| 68040.library || Functions needed on Amigas using the 68040 microprocessor chip.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= REXX: =&lt;br /&gt;
&lt;br /&gt;
REXX: is another name normally assigned to the SYS:S directory in addition to S:. Storing any ARexx programs you write in REXX: allows you to execute them without entering the full path. Create a new directory and reASSIGN REXX: to it if you wish to keep ARexx programs separate from AmigaDOS scripts.&lt;br /&gt;
&lt;br /&gt;
= LOCALE: =&lt;br /&gt;
&lt;br /&gt;
LOCALE: is where the Amiga looks for language and country files when it needs to display non-English text. On floppy systems, LOCALE: is the Locale floppy. On hard disk systems, it is the SYS:Locale directory.&lt;br /&gt;
&lt;br /&gt;
LOCALE: contains four directories:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| Countries || Contains a .country file for all available countries. These files hold country-specific information, such as date/time format and monetary symbols.&lt;br /&gt;
|-&lt;br /&gt;
| Languages || Contains .language files for the available languages. These files hold general language-specific information, such as the days of the week.&lt;br /&gt;
|-&lt;br /&gt;
| Catalogs || Contains subdirectories for the available languages, each of which contains a Sys directory. This directory holds translated text for that language. Catalogs/&amp;lt;language&amp;gt;/Sys holds menu, gadget, and message text for that language.&lt;br /&gt;
|-&lt;br /&gt;
| Help (HELP:) || Contains subdirectories for the available languages, each of which contains a Sys directory. This directory holds translated text for that language. Help/&amp;lt;language&amp;gt;/Sys is reserved for AmigaGuide text files for any applications that have AmigaGuide help in that language.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ENVARC: =&lt;br /&gt;
&lt;br /&gt;
ENVARC: is the name assigned to the directory SYS:Prefs/Env-Archive. ENVARC: always contains a Sys directory, in which each of the Preferences editors stores the .prefs file created when you save a setting with its Save gadget. Custom default icons created in IconEdit are also saved here. (Named settings saved with the Save As menu item in an Editor are stored by default in the Prefs/Presets drawer.)&lt;br /&gt;
&lt;br /&gt;
Other Workbench programs that allow you to save configuration settings, such as MultiView, also place their files in ENVARC:&lt;br /&gt;
&lt;br /&gt;
The contents of ENVARC: are copied to ENV: at boot time.&lt;br /&gt;
&lt;br /&gt;
= ENV: =&lt;br /&gt;
&lt;br /&gt;
ENV: is a cache that holds the working copy of ENVARC:. Since ENV:&#039;s contents are memory-resident, accesses to its contents do not have to read the system disk. ENV: is an Assign, into which the contents of ENVARC: are copied when booting. Preferences settings activated with Save or Use gadgets are stored in ENV:. Global environment variables are also stored here, as small files.&lt;br /&gt;
&lt;br /&gt;
In OS3.x and earlier, ENV: was assigned to a directory RAM:Env/, but in OS4, ENV: is a handler with its own storage, only accessible to the user through the ENV: assign.&lt;br /&gt;
&lt;br /&gt;
= CLIPS: =&lt;br /&gt;
&lt;br /&gt;
The directory RAM:Clipboards has the assigned name CLIPS:. It stores information clipped with the Cut or Copy items on a program&#039;s Edit menu.&lt;br /&gt;
&lt;br /&gt;
= T: =&lt;br /&gt;
&lt;br /&gt;
T: is the RAM:T directory, which may be used by scripts and some commands for storing miscellaneous temporary files.&lt;br /&gt;
&lt;br /&gt;
= Classes =&lt;br /&gt;
&lt;br /&gt;
The Classes directory stores information related to the object-oriented features of the Workbench, such as the DataTypes system upon which MultiView is based. Classes contains the directories DataTypes and Gadgets.&lt;br /&gt;
&lt;br /&gt;
= C: =&lt;br /&gt;
&lt;br /&gt;
C: is the SYS:C directory, which stores non-internal AmigaDOS commands. It is always in the search path.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:BIOS&amp;diff=9216</id>
		<title>UserDoc:BIOS</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:BIOS&amp;diff=9216"/>
		<updated>2017-09-02T03:38:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Added references to X5000 and A1222 machines, fixed some typos.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When your Amiga computer system is powered on or reset, the BIOS or firmware&#039;s job is to initialize the hardware and to start the booting process of the operating system. It also enables you to define some settings that you may want to use either for the next boot or for every time you use your computer. There are two interface modes that can be used; a console mode and a graphical mode. If you are not an expert don&#039;t panic, because once you have set up some firmware variables, you&#039;ll use the console very rarely. Typically you will only use the graphic mode, i.e. the menus, which are easier to use. Your computer can boot in many different ways, depending how you set up your variables.&lt;br /&gt;
&lt;br /&gt;
The firmware will generally not be updated very often. The reason for this is because the hardware itself is not changing. The firmware&#039;s job is to initialize the hardware to a pointer where the operating system can take over and nothing more.&lt;br /&gt;
&lt;br /&gt;
The BIOS of a new generation Amiga computer will not be explained here as it depends on the hardware. Hence, it is the manufacturer&#039;s job to provide a manual describing how the BIOS works and which options you can select to operate the computer.&lt;br /&gt;
&lt;br /&gt;
For now, there are:&lt;br /&gt;
* [http://www.denx.de/wiki/U-Boot/WebHome Das U-Boot] used on the Sam440, Sam460 and AmigaOne 500 products from [http://www.acube-systems.biz ACube Systems]. U-Boot was also used by Eyetech for their AmigaOne-XE and MicroA1-C products and various developer boards.&lt;br /&gt;
* [http://wiki.openwrt.org/doc/techref/bootloader/cfe CFE] used on the AmigaOne X1000 built by [http://a-eon.com/ A-EON Technology].&lt;br /&gt;
* [http://www.denx.de/wiki/U-Boot/WebHome Das U-Boot] used on the AmigaOne X5000 and AmigaOne A1222 built by [http://a-eon.com/ A-EON Technology].&lt;br /&gt;
* Custom [http://http://en.wikipedia.org/wiki/Open_Firmware Open Firmware] compliant firmware was used on the Pegasos2 made by Genesi.&lt;br /&gt;
&lt;br /&gt;
= Das U-Boot Environment Variables =&lt;br /&gt;
&lt;br /&gt;
Environment Variables are values that can be set during the boot process to control the behaviour of various pieces of software running on the computer. Some variables are shared by more than one process, while other are unique to a process, but there is no finite list of Environment Variables. &lt;br /&gt;
&lt;br /&gt;
== Displaying Environment Variables  ==&lt;br /&gt;
&lt;br /&gt;
To find out what Environment Variables are set on your machine type printenv at the U-Boot Console. The display will show each variable defined and its value, but it will NOT be alphabetically ordered as shown, and you will only be able to see the last 22 lines of the list.&lt;br /&gt;
&lt;br /&gt;
In order to see the complete list, you must change the &amp;quot;stdout&amp;quot; environment variable from &amp;quot;vga&amp;quot; to &amp;quot;serial&amp;quot; and use a null modem cable from the serial port on the AmigaOne connected to the serial port of another computer running a serial comms program that can display the incoming data stream.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you suspect a particular variable and want to check its contents, type printenv followed by the name of the variable, e.g.&lt;br /&gt;
&lt;br /&gt;
 ]printenv autostart&lt;br /&gt;
 autostart=yes&lt;br /&gt;
&lt;br /&gt;
== Listing Environment Variables ==&lt;br /&gt;
&lt;br /&gt;
Once AmigaOS has been installed you can obtain a complete unsorted list by typing NVGetVar from a Shell to display all of the UBoot environment variables. Typing NVGetVar &amp;gt;RAM:varlist will output the list to a file on the RAM Disk which you can print off for reference if required.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Warning|text=The battery on the motherboards used to maintain these variables has a life of around 3 years and will need to be replaced periodically. If the battery dies, or when you remove it to replace it, you will lose all of the U-Boot environment variables, so it is important to keep an up-to-date listing handy in order that you can reconfigure your machine when the need arises.}}&lt;br /&gt;
&lt;br /&gt;
==  Changing Environment Variables ==&lt;br /&gt;
&lt;br /&gt;
If you find that an Environment Variable contains the wrong value, you can change it using the &amp;quot;setenv&amp;quot; command at the U-Boot console. For example, suppose you want to change the delay time for the U-Boot Initialisation Display, you simply enter a new value for the &amp;quot;bootdelay&amp;quot; variable, i.e.&lt;br /&gt;
&lt;br /&gt;
 ]printenv bootdelay&lt;br /&gt;
 bootdelay=10&lt;br /&gt;
 ]setenv bootdelay 3&lt;br /&gt;
 ]saveenv&lt;br /&gt;
 ]printenv bootdelay&lt;br /&gt;
 bootdelay=3&lt;br /&gt;
&lt;br /&gt;
Notice that the &amp;quot;=&amp;quot; sign is NOT used when specifying values for the setenv command. However, if the value contains any embedded blanks, the value must be enclosed within &amp;quot; marks.&lt;br /&gt;
&lt;br /&gt;
==  Creating New Environment Variables ==&lt;br /&gt;
&lt;br /&gt;
Anyone can create new variables for whatever they wish, and some people even create their own variables to save them having to key in repetitive commands each time, e.g.&lt;br /&gt;
&lt;br /&gt;
 ]setenv lx &amp;quot;diskboot 500000 2:0 0; bootm&amp;quot;&lt;br /&gt;
 ]saveenv&lt;br /&gt;
 ]printenv lx&lt;br /&gt;
 lx=diskboot 500000 2:0 0; bootm&lt;br /&gt;
&lt;br /&gt;
In future, rather than having to type the full command to install Debian from CD-ROM, they can simply type &amp;quot;lx&amp;quot;. Note how more than one command can be specified on the same line separated by a semi colon &amp;quot; ; &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==  Resetting or Removing Environment Variables ==&lt;br /&gt;
&lt;br /&gt;
If you want to reset or remove an Environment Variable simply leave off the value, e.g.&lt;br /&gt;
&lt;br /&gt;
 ]setenv lx&lt;br /&gt;
 ]saveenv&lt;br /&gt;
 ]printenv lx&lt;br /&gt;
 ## Error: &amp;quot;lx&amp;quot; not defined&lt;br /&gt;
&lt;br /&gt;
== Understanding Environment Variables ==&lt;br /&gt;
&lt;br /&gt;
It can be very useful to know what some of these variables are and what they contain, particularly when things don&#039;t behave as expected, so we have compiled a list of common environment variables that we know about with typical values to give you some idea where to look.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ U-Boot Environment Variables&lt;br /&gt;
! Variable Name !! Common Values and Description&lt;br /&gt;
|-&lt;br /&gt;
| a1ide_conf&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || scan IDE buses and auto-configure&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || nothing&lt;br /&gt;
   |-&lt;br /&gt;
   | 1 || hard disk&lt;br /&gt;
   |-&lt;br /&gt;
   | 2 || dvd/cdrom reader/writer &lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
Onboard VIA686B only - specifies the configuration that a1ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| a1ide_irq&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use IRQs&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 1 || use IRQs&lt;br /&gt;
   |-&lt;br /&gt;
   | any other value || don&#039;t use IRQs&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
Onboard VIA686B only - specifies whether a1ide.device will use IRQs.&lt;br /&gt;
Using interrupts relieves the CPU (PIO approx 20%, UDMA approx 95%).&lt;br /&gt;
It also affects transfer speed (PIO 10-20% lower, UDMA 10-20% faster).&lt;br /&gt;
|-&lt;br /&gt;
| a1ide_maxbus&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || both IDE channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 0 || no IDE channel at all&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || only primary IDE channe&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || both IDE channels&lt;br /&gt;
  |}&lt;br /&gt;
Onboard VIA686B only - specifies which IDE Buses a1ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| a1ide_timeout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || 20&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 - 30 || specified timeout&lt;br /&gt;
  |}&lt;br /&gt;
Onboard VIA686B only - specifies the timeout interval in seconds for a1ide connected devices.&lt;br /&gt;
The recommended ATA(PI) specification is 30 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| a1ide_xfer&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use best PIO mode&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || Automatic (best PIO mode)&lt;br /&gt;
   |-&lt;br /&gt;
   | a || PIO 0 (3 MB/s, modeid 8)&lt;br /&gt;
   |-&lt;br /&gt;
   | b || PIO 1 (5 MB/s, modeid 9)&lt;br /&gt;
   |-&lt;br /&gt;
   | c || PIO 2 (8 MB/s, modeid 10)&lt;br /&gt;
   |-&lt;br /&gt;
   | d || PIO 3 (11 MB/s, modeid 11)&lt;br /&gt;
   |-&lt;br /&gt;
   | e || PIO 4 (16 MB/s, modeid 12)&lt;br /&gt;
   |-&lt;br /&gt;
   | A || UDMA 0 (16 MB/s, modeid 64)&lt;br /&gt;
   |-&lt;br /&gt;
   | B || UDMA 1 (25 MB/s, modeid 65)&lt;br /&gt;
   |-&lt;br /&gt;
   | C || UDMA 2 (33 MB/s, modeid 66)&lt;br /&gt;
   |-&lt;br /&gt;
   | D || UDMA 3 (44 MB/s, modeid 67)&lt;br /&gt;
   |-&lt;br /&gt;
   | E || UDMA 4 (66 MB/s, modeid 68)&lt;br /&gt;
   |-&lt;br /&gt;
   | F || UDMA 5 (100 MB/s, modeid 69)&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
Onboard VIA686B only - specifies the transfer mode that a1ide.device will use for each device.&lt;br /&gt;
If you specify an unsupported mode, it will use the best mode the drive claims to support.&lt;br /&gt;
|-&lt;br /&gt;
| agp_enable&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || enables the AGP bus&lt;br /&gt;
  |-&lt;br /&gt;
  | off || disables the AGP bus&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| agp_sideband&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || enables sideband addressing on the AGP bus&lt;br /&gt;
  |-&lt;br /&gt;
  | off || disables sideband addressing on the AGP bus&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| agp_speed&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 1x || 1X speed&lt;br /&gt;
  |-&lt;br /&gt;
  | 2x || 2X speed&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| autostart&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | yes || execute the kernel as soon as it has been loaded&lt;br /&gt;
  |-&lt;br /&gt;
  | no || do not execute the kernel after loading&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| baudrate&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 9600 (default)&lt;br /&gt;
  |-&lt;br /&gt;
  | 19200&lt;br /&gt;
  |-&lt;br /&gt;
  | 38400&lt;br /&gt;
  |-&lt;br /&gt;
  | 57600&lt;br /&gt;
  |-&lt;br /&gt;
  | 115200&lt;br /&gt;
  |-&lt;br /&gt;
  | 230400&lt;br /&gt;
  |-&lt;br /&gt;
  | 460800&lt;br /&gt;
  |-&lt;br /&gt;
  | 921600 &lt;br /&gt;
  |}&lt;br /&gt;
Serial port baud rate.&lt;br /&gt;
|-&lt;br /&gt;
| boot1&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | cdrom || IDE CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | floppy || Floppy disk&lt;br /&gt;
  |-&lt;br /&gt;
  | ide || IDE Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | net || Network&lt;br /&gt;
  |-&lt;br /&gt;
  | psii || SII Parallel Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | psiicdrom || SII Parallel CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scdrom || SCSI CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scsi || SCSI Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | sii || SII Serial Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | siicdrom || SII Serial CDROM\)&lt;br /&gt;
  |-&lt;br /&gt;
  | ucdrom || USB CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | usb || USB Disk&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the first device to boot from. Normally cdrom.&lt;br /&gt;
|-&lt;br /&gt;
| boot2&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | cdrom || IDE CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | floppy || Floppy disk&lt;br /&gt;
  |-&lt;br /&gt;
  | ide || IDE Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | net || Network&lt;br /&gt;
  |-&lt;br /&gt;
  | psii || SII Parallel Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | psiicdrom || SII Parallel CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scdrom || SCSI CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scsi || SCSI Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | sii || SII Serial Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | siicdrom || SII Serial CDROM\)&lt;br /&gt;
  |-&lt;br /&gt;
  | ucdrom || USB CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | usb || USB Disk&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the second device to boot from. Normally ide.&lt;br /&gt;
|-&lt;br /&gt;
| boot3&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | cdrom || IDE CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | floppy || Floppy disk&lt;br /&gt;
  |-&lt;br /&gt;
  | ide || IDE Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | net || Network&lt;br /&gt;
  |-&lt;br /&gt;
  | psii || SII Parallel Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | psiicdrom || SII Parallel CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scdrom || SCSI CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scsi || SCSI Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | sii || SII Serial Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | siicdrom || SII Serial CDROM\)&lt;br /&gt;
  |-&lt;br /&gt;
  | ucdrom || USB CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | usb || USB Disk&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the third device to boot from.&lt;br /&gt;
|-&lt;br /&gt;
| boot4&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | cdrom || IDE CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | floppy || Floppy disk&lt;br /&gt;
  |-&lt;br /&gt;
  | ide || IDE Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | net || Network&lt;br /&gt;
  |-&lt;br /&gt;
  | psii || SII Parallel Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | psiicdrom || SII Parallel CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scdrom || SCSI CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | scsi || SCSI Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | sii || SII Serial Disk&lt;br /&gt;
  |-&lt;br /&gt;
  | siicdrom || SII Serial CDROM\)&lt;br /&gt;
  |-&lt;br /&gt;
  | ucdrom || USB CDROM&lt;br /&gt;
  |-&lt;br /&gt;
  | usb || USB Disk&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the fourth device to boot from.&lt;br /&gt;
|-&lt;br /&gt;
| boot_command || Diskboot&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies a command to be executed to invoke a disk boot.&lt;br /&gt;
|-&lt;br /&gt;
| boot_config || Default&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the name of the AmigaOS kickstart label to boot with. The SYS:Kickstart/kicklayout file contains one or more layouts and each one has a unique label.&lt;br /&gt;
|-&lt;br /&gt;
| boot_method&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | boota || Amiga multiboot method&lt;br /&gt;
  |-&lt;br /&gt;
  | diskboot || Linux direct method&lt;br /&gt;
  |}&lt;br /&gt;
Specifies how the machine is to be booted.&lt;br /&gt;
|-&lt;br /&gt;
| boota_keep_countdown&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || Stop timer after a selection&lt;br /&gt;
  |-&lt;br /&gt;
  | off || Continue timer after a selection (default)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies whether the boota timer should continue after a selection is made.&lt;br /&gt;
|-&lt;br /&gt;
| boota_no_video_menu&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || Display selection menu&lt;br /&gt;
  |-&lt;br /&gt;
  | off || Disable selection menu (default)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies whether the boota selection menu should be suppressed.&lt;br /&gt;
|-&lt;br /&gt;
| boota_scan_all_HDD&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || Scan all hard drives&lt;br /&gt;
  |-&lt;br /&gt;
  | off || Do not scan all hard drives (default)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies whether boota should scan all Hard Disk Drives.&lt;br /&gt;
|-&lt;br /&gt;
| boota_timeout&lt;br /&gt;
| 10&lt;br /&gt;
Specifies the delay time in seconds for the Amiga Multi-boot Menu.&lt;br /&gt;
|-&lt;br /&gt;
| bootargs&lt;br /&gt;
| arg1 arg2 arg3 ...&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the argument string that should be passed to Linux on booting.&lt;br /&gt;
|-&lt;br /&gt;
| bootcmd&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | diskboot || Immediately boot from the designated disk (Linux).&lt;br /&gt;
  |-&lt;br /&gt;
  | &amp;quot;menu; run menuboot_cmd&amp;quot; || Execute the &amp;quot;menu&amp;quot; command and then run the command in the &amp;quot;menuboot_cmd&amp;quot; variable (AmigaOS).&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| bootdelay&lt;br /&gt;
| 5&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the delay time in seconds for the U-Boot Initialisation Display.&lt;br /&gt;
|-&lt;br /&gt;
| bootdevice&lt;br /&gt;
| Specifies the hardware device for Linux to boot from.&lt;br /&gt;
|-&lt;br /&gt;
| ethact&lt;br /&gt;
| Specifies the Ethernet device.&lt;br /&gt;
|-&lt;br /&gt;
| ethaddr&lt;br /&gt;
| Specifies your unique Ethernet (MAC) address for network operation.&lt;br /&gt;
|-&lt;br /&gt;
| ide&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || defaults to VIA IDE&lt;br /&gt;
  |-&lt;br /&gt;
  | psii || sii0680ide (PATA)&lt;br /&gt;
  |-&lt;br /&gt;
  | ssii || sii3112ide, sii3114ide or sii3512ide (SATA)&lt;br /&gt;
  |}&lt;br /&gt;
SIIxxxx only - Specifies the type of drives U-Boot should use for booting.&lt;br /&gt;
|-&lt;br /&gt;
| ide_cd_timeout&lt;br /&gt;
| 30&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the time in seconds to wait for an IDE CDROM drive before timing out.&lt;br /&gt;
|-&lt;br /&gt;
| ide_doreset&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on (default)&lt;br /&gt;
  |-&lt;br /&gt;
  | off&lt;br /&gt;
  |}&lt;br /&gt;
Specifies whether to run &amp;quot;ide reset&amp;quot; as part of the boot sequence.&lt;br /&gt;
|-&lt;br /&gt;
| ide_maxbus 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || no devices attached to either channel&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || devices only attached to channel 1&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || devices attached to both channels&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the maximum number of active IDE Buses for the onboard VIA controller.&lt;br /&gt;
|-&lt;br /&gt;
| ide_swap 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || use normal channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || swap channels&lt;br /&gt;
  |}&lt;br /&gt;
Specifies that the Primary and Secondary bus should be swapped.&lt;br /&gt;
|-&lt;br /&gt;
| ipaddr&lt;br /&gt;
| Specifies the local TCP/IP address for network booting - only used for TFTP booting.&lt;br /&gt;
|-&lt;br /&gt;
| kbddev_mapping&lt;br /&gt;
| fromkey=tokey (fromkey=tokey....)&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies whether keyboard remapping is required and which key(s) should be remapped and is typically used where a keyboard may not have particular keys.&lt;br /&gt;
|-&lt;br /&gt;
| kbddev_norwin&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | off || Do not remap keys (default)&lt;br /&gt;
  |-&lt;br /&gt;
  | on || Right Windows key should be mapped as the Menu key.&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| kbddev_sysreqishelp&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | off || Do not remap keys (default)&lt;br /&gt;
  |-&lt;br /&gt;
  | on || Map PRNSCR/SYSREQ or PRNSCR/SYSRQ (as shown on many keyboards) key should be mapped as the Help key.&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| limit_memory&lt;br /&gt;
| 512&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies a memory limit to restrict use of the available memory.\&lt;br /&gt;
|-&lt;br /&gt;
| menu_netboot&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | DHCP&lt;br /&gt;
  |-&lt;br /&gt;
  | BOOTP&lt;br /&gt;
  |-&lt;br /&gt;
  | ARP&lt;br /&gt;
  |-&lt;br /&gt;
  | TFTP&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the network boot type when booting over a network. It is not used by AmigaOS or boota. &lt;br /&gt;
|-&lt;br /&gt;
| menuboot_cmd 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set)&lt;br /&gt;
  |-&lt;br /&gt;
  | &amp;quot;ide reset; diskboot&amp;quot; || Linux&lt;br /&gt;
  |-&lt;br /&gt;
  | &amp;quot;ide reset; boota; boota; boota&amp;quot; || AmigaOS Multiboot&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the commands to be issued on completion of the Menuboot delay.&amp;lt;br/&amp;gt;&lt;br /&gt;
Note the AmigaOS Multiboot sequence requires a command for each bootable device so boota is repeated.&lt;br /&gt;
|-&lt;br /&gt;
| menuboot_delay&lt;br /&gt;
| 3&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the delay time in seconds for the Menuboot Delay panel.&lt;br /&gt;
|-&lt;br /&gt;
| menucmd&lt;br /&gt;
| menu&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the command to be executed to invoke the boot menu.&lt;br /&gt;
|-&lt;br /&gt;
| os4_commandline&lt;br /&gt;
| debuglevel=0&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the argument string that should be passed to the AmigaOS kernel on booting.&lt;br /&gt;
|-&lt;br /&gt;
| parallel_address&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 278&lt;br /&gt;
  |-&lt;br /&gt;
  | 378 (normal)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the Parallel Port address.&lt;br /&gt;
|-&lt;br /&gt;
| parallel_mode 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || ECP&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || EPP&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || Off (normal)&lt;br /&gt;
  |-&lt;br /&gt;
  | 3 || UNI&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the Parallel Port mode.&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqa || 9&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the IRQ level for PCI Interrupt A.&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqa_select&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | edge || Edge-triggered interrupts.&lt;br /&gt;
  |-&lt;br /&gt;
  | level || Level-triggered interrupts. (normal)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqb || 10&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the IRQ level for PCI Interrupt B.&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqb_select&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | edge || Edge-triggered interrupts.&lt;br /&gt;
  |-&lt;br /&gt;
  | level || Level-triggered interrupts. (normal)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqc || 11&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the IRQ level for PCI Interrupt C.&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqc_select&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | edge || Edge-triggered interrupts.&lt;br /&gt;
  |-&lt;br /&gt;
  | level || Level-triggered interrupts. (normal)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqd || 7&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies the IRQ level for PCI Interrupt D.&lt;br /&gt;
|-&lt;br /&gt;
| pci_irqd_select&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | edge || Edge-triggered interrupts.&lt;br /&gt;
  |-&lt;br /&gt;
  | level || Level-triggered interrupts. (normal)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| preboot || (not set)&amp;lt;br/&amp;gt;&lt;br /&gt;
Specifies any pre-boot commands.&lt;br /&gt;
|-&lt;br /&gt;
| rescan_bootunits&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | off (normal)&lt;br /&gt;
  |-&lt;br /&gt;
  | on&lt;br /&gt;
  |}&lt;br /&gt;
Specifies whether boota should rescan all of the boot units.&lt;br /&gt;
|-&lt;br /&gt;
| serial1_address&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 2E8&lt;br /&gt;
  |-&lt;br /&gt;
  | 2F8&lt;br /&gt;
  |-&lt;br /&gt;
  | 3E8&lt;br /&gt;
  |-&lt;br /&gt;
  | 3F8 (normal)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the hardware address where Serial port 1 will be located.&lt;br /&gt;
|-&lt;br /&gt;
| serial2_address&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 2E8&lt;br /&gt;
  |-&lt;br /&gt;
  | 2F8 (normal)&lt;br /&gt;
  |-&lt;br /&gt;
  | 3E8&lt;br /&gt;
  |-&lt;br /&gt;
  | 3F8&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the hardware address where Serial port 2 will be located.&lt;br /&gt;
|-&lt;br /&gt;
| serverip&lt;br /&gt;
| Specifies the server IP address.&amp;lt;br/&amp;gt;&lt;br /&gt;
The server must be running a supported networking boot service.&lt;br /&gt;
|-&lt;br /&gt;
| sii0680ide_conf&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || scan IDE buses and auto-configure&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || nothing&lt;br /&gt;
   |-&lt;br /&gt;
   | 1 || hard disk&lt;br /&gt;
   |-&lt;br /&gt;
   | 2 || dvd/cdrom reader/writer &lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII0680 only - specifies the configuration that sii0680ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii0680ide_irq&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use IRQs&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 1 || use IRQs&lt;br /&gt;
   |-&lt;br /&gt;
   | any other value || don&#039;t use IRQs&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII0680 only - specifies whether sii0680ide.device will use IRQs.&lt;br /&gt;
Using interrupts relieves the CPU (PIO approx 20%, UDMA approx 95%).&lt;br /&gt;
It also affects transfer speed (PIO 10-20% lower, UDMA 10-20% faster).&lt;br /&gt;
|-&lt;br /&gt;
| sii0680ide_maxbus&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || both IDE channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 0 || no IDE channel at all&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || only primary IDE channe&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || both IDE channels&lt;br /&gt;
  |}&lt;br /&gt;
SII0680 only - specifies which IDE Buses sii0680ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii0680ide_timeout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || 20&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 - 30 || specified timeout&lt;br /&gt;
  |}&lt;br /&gt;
SII0680 only - specifies the timeout interval in seconds for sii0680ide connected devices.&lt;br /&gt;
The recommended ATA(PI) specification is 30 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| sii0680ide_xfer&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use best UDMA mode (best PIO mode on Eyetech boards)&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || Automatic (same as not set)&lt;br /&gt;
   |-&lt;br /&gt;
   | a || PIO 0 (3 MB/s, modeid 8)&lt;br /&gt;
   |-&lt;br /&gt;
   | b || PIO 1 (5 MB/s, modeid 9)&lt;br /&gt;
   |-&lt;br /&gt;
   | c || PIO 2 (8 MB/s, modeid 10)&lt;br /&gt;
   |-&lt;br /&gt;
   | d || PIO 3 (11 MB/s, modeid 11)&lt;br /&gt;
   |-&lt;br /&gt;
   | e || PIO 4 (16 MB/s, modeid 12)&lt;br /&gt;
   |-&lt;br /&gt;
   | A || UDMA 0 (16 MB/s, modeid 64)&lt;br /&gt;
   |-&lt;br /&gt;
   | B || UDMA 1 (25 MB/s, modeid 65)&lt;br /&gt;
   |-&lt;br /&gt;
   | C || UDMA 2 (33 MB/s, modeid 66)&lt;br /&gt;
   |-&lt;br /&gt;
   | D || UDMA 3 (44 MB/s, modeid 67)&lt;br /&gt;
   |-&lt;br /&gt;
   | E || UDMA 4 (66 MB/s, modeid 68)&lt;br /&gt;
   |-&lt;br /&gt;
   | F || UDMA 5 (100 MB/s, modeid 69)&lt;br /&gt;
   |-&lt;br /&gt;
   | G || UDMA 6 (133 MB/s, modeid 70)&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII0680 only - specifies the transfer mode that sii0680ide.device will use for each device.&lt;br /&gt;
If you specify an unsupported mode, it will use the best mode the drive claims to support.&lt;br /&gt;
|-&lt;br /&gt;
| sii3112ide_conf&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || scan IDE buses and auto-configure&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || nothing&lt;br /&gt;
   |-&lt;br /&gt;
   | 1 || hard disk&lt;br /&gt;
   |-&lt;br /&gt;
   | 2 || dvd/cdrom reader/writer &lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3112 only - specifies the configuration that sii3112ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3112ide_irq&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use IRQs&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 1 || use IRQs&lt;br /&gt;
   |-&lt;br /&gt;
   | any other value || don&#039;t use IRQs&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3112 only - specifies whether sii3112ide.device will use IRQs.&lt;br /&gt;
Using interrupts relieves the CPU (PIO approx 20%, UDMA approx 95%).&lt;br /&gt;
It also affects transfer speed (PIO 10-20% lower, UDMA 10-20% faster).&lt;br /&gt;
|-&lt;br /&gt;
| sii3112ide_maxbus&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || both IDE channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 0 || no IDE channel at all&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || only primary IDE channel&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || both IDE channels&lt;br /&gt;
  |}&lt;br /&gt;
SII3112 only - specifies which IDE Buses sii3112ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3112ide_timeout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || 20&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 - 30 || specified timeout&lt;br /&gt;
  |}&lt;br /&gt;
SII3112 only - specifies the timeout interval in seconds for sii3112ide connected devices.&lt;br /&gt;
The recommended ATA(PI) specification is 30 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| sii3112ide_xfer&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use best UDMA mode (best PIO mode on Eyetech boards)&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || Automatic (same as not set)&lt;br /&gt;
   |-&lt;br /&gt;
   | a || PIO 0 (3 MB/s, modeid 8)&lt;br /&gt;
   |-&lt;br /&gt;
   | b || PIO 1 (5 MB/s, modeid 9)&lt;br /&gt;
   |-&lt;br /&gt;
   | c || PIO 2 (8 MB/s, modeid 10)&lt;br /&gt;
   |-&lt;br /&gt;
   | d || PIO 3 (11 MB/s, modeid 11)&lt;br /&gt;
   |-&lt;br /&gt;
   | e || PIO 4 (16 MB/s, modeid 12)&lt;br /&gt;
   |-&lt;br /&gt;
   | A || UDMA 0 (16 MB/s, modeid 64)&lt;br /&gt;
   |-&lt;br /&gt;
   | B || UDMA 1 (25 MB/s, modeid 65)&lt;br /&gt;
   |-&lt;br /&gt;
   | C || UDMA 2 (33 MB/s, modeid 66)&lt;br /&gt;
   |-&lt;br /&gt;
   | D || UDMA 3 (44 MB/s, modeid 67)&lt;br /&gt;
   |-&lt;br /&gt;
   | E || UDMA 4 (66 MB/s, modeid 68)&lt;br /&gt;
   |-&lt;br /&gt;
   | F || UDMA 5 (100 MB/s, modeid 69)&lt;br /&gt;
   |-&lt;br /&gt;
   | G || UDMA 6 (133 MB/s, modeid 70)&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3112 only - specifies the transfer mode that sii3112ide.device will use for each device.&lt;br /&gt;
If you specify an unsupported mode, it will use the best mode the drive claims to support.&lt;br /&gt;
|-&lt;br /&gt;
| sii3114ide_conf&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || scan IDE buses and auto-configure&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || nothing&lt;br /&gt;
   |-&lt;br /&gt;
   | 1 || hard disk&lt;br /&gt;
   |-&lt;br /&gt;
   | 2 || dvd/cdrom reader/writer &lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3114 only - specifies the configuration that sii3114ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3114ide_irq&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use IRQs&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 1 || use IRQs&lt;br /&gt;
   |-&lt;br /&gt;
   | any other value || don&#039;t use IRQs&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3114 only - specifies whether sii3114ide.device will use IRQs.&lt;br /&gt;
Using interrupts relieves the CPU (PIO approx 20%, UDMA approx 95%).&lt;br /&gt;
It also affects transfer speed (PIO 10-20% lower, UDMA 10-20% faster).&lt;br /&gt;
|-&lt;br /&gt;
| sii3114ide_maxbus&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || both IDE channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 0 || no IDE channel at all&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || only primary IDE channel&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || both IDE channels&lt;br /&gt;
  |}&lt;br /&gt;
SII3114 only - specifies which IDE Buses sii3114ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3114ide_timeout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || 20&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 - 30 || specified timeout&lt;br /&gt;
  |}&lt;br /&gt;
SII3114 only - specifies the timeout interval in seconds for sii3114ide connected devices.&lt;br /&gt;
The recommended ATA(PI) specification is 30 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| sii3114ide_xfer&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use best UDMA mode (best PIO mode on Eyetech boards)&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 chars - (primary master,primary slave,secondary master,secondary slave)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || Automatic (same as not set)&lt;br /&gt;
   |-&lt;br /&gt;
   | a || PIO 0 (3 MB/s, modeid 8)&lt;br /&gt;
   |-&lt;br /&gt;
   | b || PIO 1 (5 MB/s, modeid 9)&lt;br /&gt;
   |-&lt;br /&gt;
   | c || PIO 2 (8 MB/s, modeid 10)&lt;br /&gt;
   |-&lt;br /&gt;
   | d || PIO 3 (11 MB/s, modeid 11)&lt;br /&gt;
   |-&lt;br /&gt;
   | e || PIO 4 (16 MB/s, modeid 12)&lt;br /&gt;
   |-&lt;br /&gt;
   | A || UDMA 0 (16 MB/s, modeid 64)&lt;br /&gt;
   |-&lt;br /&gt;
   | B || UDMA 1 (25 MB/s, modeid 65)&lt;br /&gt;
   |-&lt;br /&gt;
   | C || UDMA 2 (33 MB/s, modeid 66)&lt;br /&gt;
   |-&lt;br /&gt;
   | D || UDMA 3 (44 MB/s, modeid 67)&lt;br /&gt;
   |-&lt;br /&gt;
   | E || UDMA 4 (66 MB/s, modeid 68)&lt;br /&gt;
   |-&lt;br /&gt;
   | F || UDMA 5 (100 MB/s, modeid 69)&lt;br /&gt;
   |-&lt;br /&gt;
   | G || UDMA 6 (133 MB/s, modeid 70)&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3114 only - specifies the transfer mode that sii3114ide.device will use for each device.&lt;br /&gt;
If you specify an unsupported mode, it will use the best mode the drive claims to support.&lt;br /&gt;
|-&lt;br /&gt;
| sii3512ide_conf&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || scan IDE buses and auto-configure&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || nothing&lt;br /&gt;
   |-&lt;br /&gt;
   | 1 || hard disk&lt;br /&gt;
   |-&lt;br /&gt;
   | 2 || dvd/cdrom reader/writer &lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3512 only - specifies the configuration that sii3512ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3512ide_irq&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use IRQs&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 1 || use IRQs&lt;br /&gt;
   |-&lt;br /&gt;
   | any other value || don&#039;t use IRQs&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3512 only - specifies whether sii3512ide.device will use IRQs.&lt;br /&gt;
Using interrupts relieves the CPU (PIO approx 20%, UDMA approx 95%).&lt;br /&gt;
It also affects transfer speed (PIO 10-20% lower, UDMA 10-20% faster).&lt;br /&gt;
|-&lt;br /&gt;
| sii3512ide_maxbus&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || both IDE channels&lt;br /&gt;
  |-&lt;br /&gt;
  | 0 || no IDE channel at all&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || only primary IDE channel&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || both IDE channels&lt;br /&gt;
  |}&lt;br /&gt;
SII3512 only - specifies which IDE Buses sii3512ide.device will use.&lt;br /&gt;
|-&lt;br /&gt;
| sii3512ide_timeout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || 20&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 - 30 || specified timeout&lt;br /&gt;
  |}&lt;br /&gt;
SII3512 only - specifies the timeout interval in seconds for sii3512ide connected devices.&lt;br /&gt;
The recommended ATA(PI) specification is 30 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| sii3512ide_xfer&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | (not set) || use best UDMA mode (best PIO mode on Eyetech boards)&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 chars - (primary bus/unit0,secondary bus/unit1)&lt;br /&gt;
  |&lt;br /&gt;
  {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
   | 0 || Automatic (same as not set)&lt;br /&gt;
   |-&lt;br /&gt;
   | a || PIO 0 (3 MB/s, modeid 8)&lt;br /&gt;
   |-&lt;br /&gt;
   | b || PIO 1 (5 MB/s, modeid 9)&lt;br /&gt;
   |-&lt;br /&gt;
   | c || PIO 2 (8 MB/s, modeid 10)&lt;br /&gt;
   |-&lt;br /&gt;
   | d || PIO 3 (11 MB/s, modeid 11)&lt;br /&gt;
   |-&lt;br /&gt;
   | e || PIO 4 (16 MB/s, modeid 12)&lt;br /&gt;
   |-&lt;br /&gt;
   | A || UDMA 0 (16 MB/s, modeid 64)&lt;br /&gt;
   |-&lt;br /&gt;
   | B || UDMA 1 (25 MB/s, modeid 65)&lt;br /&gt;
   |-&lt;br /&gt;
   | C || UDMA 2 (33 MB/s, modeid 66)&lt;br /&gt;
   |-&lt;br /&gt;
   | D || UDMA 3 (44 MB/s, modeid 67)&lt;br /&gt;
   |-&lt;br /&gt;
   | E || UDMA 4 (66 MB/s, modeid 68)&lt;br /&gt;
   |-&lt;br /&gt;
   | F || UDMA 5 (100 MB/s, modeid 69)&lt;br /&gt;
   |-&lt;br /&gt;
   | G || UDMA 6 (133 MB/s, modeid 70)&lt;br /&gt;
   |}&lt;br /&gt;
  |}&lt;br /&gt;
SII3512 only - specifies the transfer mode that sii3512ide.device will use for each device.&lt;br /&gt;
If you specify an unsupported mode, it will use the best mode the drive claims to support.&lt;br /&gt;
|-&lt;br /&gt;
| stdin&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | amiga || Catweasel with Classic Amiga keyboard&lt;br /&gt;
  |-&lt;br /&gt;
  | amikbd || Catweasel with Classic Amiga keyboard&lt;br /&gt;
  |-&lt;br /&gt;
  | ps2 || standard PS2 keyboard&lt;br /&gt;
  |-&lt;br /&gt;
  | ps2kbd || standard PS2 keyboard (normal)&lt;br /&gt;
  |-&lt;br /&gt;
  | serial || external serial port&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the standard input device.&lt;br /&gt;
|-&lt;br /&gt;
| stdout&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | serial || external serial port&lt;br /&gt;
  |-&lt;br /&gt;
  | vga || VGA display device (normal)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the standard output device.&lt;br /&gt;
|-&lt;br /&gt;
| usb0_enable&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || Enable back panel ports (0/1)&lt;br /&gt;
  |-&lt;br /&gt;
  | off || Disable back panel ports (0/1)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| usb1_enable&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | on || Enable header ports (2/3)&lt;br /&gt;
  |-&lt;br /&gt;
  | off || Disable header ports (2/3)&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| usb_use_header&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || Use rear USB ports&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || Use front USB ports&lt;br /&gt;
  |}&lt;br /&gt;
|-&lt;br /&gt;
| use_memory_limit&lt;br /&gt;
| yes&lt;br /&gt;
Specifies whether the &amp;quot;memory_limit&amp;quot; variable is to be used.&lt;br /&gt;
|-&lt;br /&gt;
| vga_bg_color 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || Black (default)&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || Blue&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || Green&lt;br /&gt;
  |-&lt;br /&gt;
  | 3 || Cyan&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 || Red&lt;br /&gt;
  |-&lt;br /&gt;
  | 5 || Magenta&lt;br /&gt;
  |-&lt;br /&gt;
  | 6 || Brown (Dark Yellow)&lt;br /&gt;
  |-&lt;br /&gt;
  | 7 || Light Gray&lt;br /&gt;
  |-&lt;br /&gt;
  | 8 || Dark Gray&lt;br /&gt;
  |-&lt;br /&gt;
  | 9 || Light Blue&lt;br /&gt;
  |-&lt;br /&gt;
  | 10 || Light Green&lt;br /&gt;
  |-&lt;br /&gt;
  | 11 || Light Cyan&lt;br /&gt;
  |-&lt;br /&gt;
  | 12 || Light Red&lt;br /&gt;
  |-&lt;br /&gt;
  | 13 || Light Magenta&lt;br /&gt;
  |-&lt;br /&gt;
  | 14 || Light Yellow&lt;br /&gt;
  |-&lt;br /&gt;
  | 15 || White&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the background color for the UBoot initialisation screens.&lt;br /&gt;
|-&lt;br /&gt;
| vga_fg_color 	&lt;br /&gt;
|&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  | 0 || Black&lt;br /&gt;
  |-&lt;br /&gt;
  | 1 || Blue&lt;br /&gt;
  |-&lt;br /&gt;
  | 2 || Green&lt;br /&gt;
  |-&lt;br /&gt;
  | 3 || Cyan&lt;br /&gt;
  |-&lt;br /&gt;
  | 4 || Red&lt;br /&gt;
  |-&lt;br /&gt;
  | 5 || Magenta&lt;br /&gt;
  |-&lt;br /&gt;
  | 6 || Brown (Dark Yellow)&lt;br /&gt;
  |-&lt;br /&gt;
  | 7 || Light Gray&lt;br /&gt;
  |-&lt;br /&gt;
  | 8 || Dark Gray&lt;br /&gt;
  |-&lt;br /&gt;
  | 9 || Light Blue&lt;br /&gt;
  |-&lt;br /&gt;
  | 10 || Light Green&lt;br /&gt;
  |-&lt;br /&gt;
  | 11 || Light Cyan&lt;br /&gt;
  |-&lt;br /&gt;
  | 12 || Light Red&lt;br /&gt;
  |-&lt;br /&gt;
  | 13 || Light Magenta&lt;br /&gt;
  |-&lt;br /&gt;
  | 14 || Light Yellow&lt;br /&gt;
  |-&lt;br /&gt;
  | 15 || White (default)&lt;br /&gt;
  |}&lt;br /&gt;
Specifies the foreground color for the UBoot initialisation screens.&lt;br /&gt;
|-&lt;br /&gt;
| video_num&lt;br /&gt;
| 1&lt;br /&gt;
Specifies the number of video devices.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9215</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9215"/>
		<updated>2017-09-02T02:47:58Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;; Configuration name&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
; Exec name&lt;br /&gt;
EXEC Kickstart/loader.of&lt;br /&gt;
;&lt;br /&gt;
; PPC native modules&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/kernel&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/FastFileSystem&lt;br /&gt;
MODULE Kickstart/CDFileSystem&lt;br /&gt;
MODULE Kickstart/NGFileSystem&lt;br /&gt;
;&lt;br /&gt;
(etc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when needed. These files are stored in different directories in the system volume.&lt;br /&gt;
A default AmigaOS installation looks like this:&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definitions for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains Internet-related files and configurations&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Lib&#039;&#039;&#039;rairies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to customise the system for your locality (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the files needed for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the system&#039;s &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files, not currently used&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default, Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add to the list all files from libs:xad and also xadmaster.library. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Classic Amigas with PowerPC accelerators, the original AmigaOne SE/XE and the Sam series of Amigas all use the Second Level Booter (SLB) to read their Kickstart modules from the system volume. The newer A-Eon machines (X1000, X5000, A1222) all use a loader called AmigaBoot. In the X1000, AmigaBoot must be read from an FFS partition, while in the later machines, it is stored in the on-board CF card. The process of loading the kickstart modules is the same in all cases.&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
The BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information is displayed. This shows if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly set up to make this drive useable.&lt;br /&gt;
* Depending on the machine type, the BIOS will look on the harddisk to find the Second Level Booter (SLB) or AmigaBoot, or will execute the AmigaBoot program from the on-board NVRAM. Whereas the BIOS does not know about AmigaOS disk structure, the SLB/AmigaBoot can &#039;&#039;understand&#039;&#039; the AmigaOS partitions and file systems. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
SLB/AmigaBoot analyses all Amiga partitions on the system disk. It reads each system configuration it finds on the partition and displays them all for the user to select one to load. AmigaBoot (not SLB) also displays configurations from Kickstart/Kicklayout files on every &amp;quot;bootable&amp;quot; partition.&lt;br /&gt;
The user can [[UserDoc:How_AmigaOS_Works#Control_of_the_Kickstart|define]] many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
SLB/AmigaBoot loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* The AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* The Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* The Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9214</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9214"/>
		<updated>2017-09-02T02:22:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;; Configuration name&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
; Exec name&lt;br /&gt;
EXEC Kickstart/loader.of&lt;br /&gt;
;&lt;br /&gt;
; PPC native modules&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/kernel&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/FastFileSystem&lt;br /&gt;
MODULE Kickstart/CDFileSystem&lt;br /&gt;
MODULE Kickstart/NGFileSystem&lt;br /&gt;
;&lt;br /&gt;
(etc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when needed. These files are stored in different directories in the system volume.&lt;br /&gt;
A default AmigaOS installation looks like this:&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definitions for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains Internet-related files and configurations&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Lib&#039;&#039;&#039;rairies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to customise the system for your locality (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the files needed for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the system&#039;s &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files, not currently used&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default, Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add to the list all files from libs:xad and also xadmaster.library. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Classic Amigas with PowerPC accelerators, the original AmigaOne SE/XE and the Sam series of Amigas all use the Second Level Booter (SLB) to read their Kickstart modules from the system volume. The newer A-Eon machines (X1000, X5000, A1222) all use a loader called AmigaBoot. In the X1000, AmigaBoot must be read from an FFS partition, while in the later machines, it is stored in the on-board CF card. The process of loading the kickstart modules is the same in all cases.&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
The BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information is displayed. This shows if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly set up to make this drive useable.&lt;br /&gt;
* Depending on how you set up the BIOS it will look on the harddisk to find the Second Level Booter (SLB) or will execute the AmigaBoot program from the on-board NVRAM. Whereas the BIOS does not know about AmigaOS disk structure, the SLB/AmigaBoot will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
SLB/AmigaBoot analyses all Amiga partitions on the system disk. It reads each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partition. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
SLB/AmigaBoot loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* The AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* The Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* The Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9213</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9213"/>
		<updated>2017-09-02T02:18:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;; Configuration name&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
; Exec name&lt;br /&gt;
EXEC Kickstart/loader.of&lt;br /&gt;
;&lt;br /&gt;
; PPC native modules&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/kernel&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/FastFileSystem&lt;br /&gt;
MODULE Kickstart/CDFileSystem&lt;br /&gt;
MODULE Kickstart/NGFileSystem&lt;br /&gt;
;&lt;br /&gt;
(etc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when needed. These files are stored in different directories in the system volume.&lt;br /&gt;
A default AmigaOS installation looks like this:&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definitions for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains Internet-related files and configurations&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Lib&#039;&#039;&#039;rairies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to customise the system for your locality (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the files needed for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the system&#039;s &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files, not currently used&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default, Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add to the list all files from libs:xad and also xadmaster.library. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Classic Amigas with PowerPC accelerators, the original AmigaOne SE/XE and the Sam series of Amigas all use the Second Level Booter (SLB) to read their Kickstart modules from the system volume. The newer A-Eon machines (X1000, X5000, A1222) all use a loader called AmigaBoot, which is stored in the on-board NVRAM or CF card. The process of loading the kickstart modules is the same in all cases.&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
The BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information is displayed. This shows if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly set up to make this drive useable.&lt;br /&gt;
* Depending on how you set up the BIOS it will look on the harddisk to find the Second Level Booter (SLB) or will execute the AmigaBoot program from the on-board NVRAM. Whereas the BIOS does not know about AmigaOS disk structure, the SLB/AmigaBoot will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
SLB/AmigaBoot analyses all Amiga partitions on the system disk. It reads each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partition. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
SLB/AmigaBoot loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* The AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* The Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* The Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9212</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9212"/>
		<updated>2017-09-02T02:01:11Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;; Configuration name&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
; Exec name&lt;br /&gt;
EXEC Kickstart/loader.of&lt;br /&gt;
;&lt;br /&gt;
; PPC native modules&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/kernel&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/FastFileSystem&lt;br /&gt;
MODULE Kickstart/CDFileSystem&lt;br /&gt;
MODULE Kickstart/NGFileSystem&lt;br /&gt;
;&lt;br /&gt;
(etc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when needed. These files are stored in different directories in the system volume.&lt;br /&gt;
A default AmigaOS installation looks like this:&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definitions for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains Internet-related files and configurations&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Lib&#039;&#039;&#039;rairies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to customise the system for your locality (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the files needed for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the system&#039;s &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files, not currently used&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list file.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add all files from libs:xad and also xadmaster.library to the list. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
the BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information are displayed. This allows to see if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly setup to make this drive useable.&lt;br /&gt;
* depending on how you setup the BIOS it will look on the harddisk to find the Second Level Booter (SLB). This program is stored on the first sectors of the disk. Whereas the BIOS does not know about AmigaOS disk structure, the SLB will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
the SLB will analyses all Amiga partitions on the disk it is installed on. It will read each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partitions. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
the SLB loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* the AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* the Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* the Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9211</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9211"/>
		<updated>2017-09-02T01:49:08Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
[[File: kicklayout.png|frame|right|Portion of a typical Kicklayout]]&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when needed. These files are stored in different directories in the system volume.&lt;br /&gt;
A default AmigaOS installation looks like this:&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definitions for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains Internet-related files and configurations&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Lib&#039;&#039;&#039;rairies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to customise the system for your locality (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the files needed for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the system&#039;s &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files, not currently used&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list file.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add all files from libs:xad and also xadmaster.library to the list. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
the BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information are displayed. This allows to see if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly setup to make this drive useable.&lt;br /&gt;
* depending on how you setup the BIOS it will look on the harddisk to find the Second Level Booter (SLB). This program is stored on the first sectors of the disk. Whereas the BIOS does not know about AmigaOS disk structure, the SLB will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
the SLB will analyses all Amiga partitions on the disk it is installed on. It will read each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partitions. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
the SLB loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* the AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* the Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* the Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9210</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9210"/>
		<updated>2017-09-02T01:43:27Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that translates them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable and script bits set.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we must read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duty is to draw graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find them all in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory on the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like the conductor of an orchestra. Its job is to make everything work together. It creates processes, handles memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a unique kernel that has existed since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the user can employ to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the reads/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles access to the different filesystems&lt;br /&gt;
* gadtools.library.kmod - a collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the reads/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - a collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - a set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - a collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the reads/writes to the NVRAM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handle the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039;.&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform low level graphic operations on graphics cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded optionally. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout (now obsolescent)&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* NGFileSystem - an experimental file system designed to gradually replace the FastFileSystem&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allows the use of disks connected to a disk controller. These files are named after the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows the use of disks connected to a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to load the default configuration or to select any one of the other configurations. Often a developer will have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
[[File: kicklayout.png|frame|right|Portion of a typical Kicklayout]]&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;on the system volume&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when used. These files are stored in different directories in the system volume.&lt;br /&gt;
Here is described a default AmigaOS installation.&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definition for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains a dialer to connect to Internet&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Libr&#039;&#039;&#039;airies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to localise the system (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the needed files for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list file.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add all files from libs:xad and also xadmaster.library to the list. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
the BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information are displayed. This allows to see if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly setup to make this drive useable.&lt;br /&gt;
* depending on how you setup the BIOS it will look on the harddisk to find the Second Level Booter (SLB). This program is stored on the first sectors of the disk. Whereas the BIOS does not know about AmigaOS disk structure, the SLB will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
the SLB will analyses all Amiga partitions on the disk it is installed on. It will read each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partitions. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
the SLB loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* the AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* the Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* the Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9209</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9209"/>
		<updated>2017-09-02T01:13:11Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that transcripts them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable bit, and the script bit.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we could read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duties is to do graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find all them in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory in the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like a conductor in an orchestra. Its job is to make everything works together. It creates processes, handle memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a self made kernel that works since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the use can use to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs the read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the read/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles the use of the different filesystems&lt;br /&gt;
* gadtools.library.kmod - collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the read/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles of input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the read/writes to the EEPROM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handles the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039; special disk&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform lowlevel graphic operations on graphic cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded or left aside. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allow the use of disks connected to a disk controller. These files are named with the name of the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows to use disks connected on a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
==== Misc modules ====&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
== Control of the Kickstart ==&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to allow the default configuration or to select any one of the other configurations. Often a developer may have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
[[File: kicklayout.png|frame|right|Portion of a typical Kicklayout]]&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; keyword and should be separated from the previous configuration by a blank line. The blank line signifies &amp;quot;Stop loading here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;&#039;on the system volume&#039;&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
If you do not specify a default configuration with the &amp;quot;boot_config&amp;quot; variable, the boot loader will default to the first configuration in the Kicklayout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when used. These files are stored in different directories in the system volume.&lt;br /&gt;
Here is described a default AmigaOS installation.&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definition for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains a dialer to connect to Internet&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Libr&#039;&#039;&#039;airies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to localise the system (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the needed files for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list file.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add all files from libs:xad and also xadmaster.library to the list. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
the BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information are displayed. This allows to see if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly setup to make this drive useable.&lt;br /&gt;
* depending on how you setup the BIOS it will look on the harddisk to find the Second Level Booter (SLB). This program is stored on the first sectors of the disk. Whereas the BIOS does not know about AmigaOS disk structure, the SLB will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
the SLB will analyses all Amiga partitions on the disk it is installed on. It will read each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partitions. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
the SLB loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* the AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* the Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* the Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9208</id>
		<title>UserDoc:How AmigaOS Works</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=UserDoc:How_AmigaOS_Works&amp;diff=9208"/>
		<updated>2017-09-02T00:39:14Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Added editing description for Kicklayout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As already mentioned, AmigaOS was a pioneer in the early days of personal computing in delivering sophistication that contemporary systems could only have dreamt of and pretended to offer. Today, AmigaOS continues to offer a straightforward elegance that seems to be overlooked in the development of other platforms. Thanks to the concepts behind AmigaOS, the system is easy to understand and to use by everyone.&lt;br /&gt;
&lt;br /&gt;
In this page we will explore all these concepts of AmigaOS. Also you will learn here the naming of all parts of the system.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of different components which are either mandatory (i.e.,  AmigaOS will not work without them) or components the user can choose to use or not. All these components can have one or mutiple interfaces a user or a developer can use to operate with the components and through them to control the operating system.&lt;br /&gt;
&lt;br /&gt;
= The most important components =&lt;br /&gt;
&lt;br /&gt;
== Exec, the AmigaOS kernel ==&lt;br /&gt;
&lt;br /&gt;
Exec is the kernel of AmigaOS. It is the component that pilots all other components. It is responsible for running programs, dealing with computer memory and managing low-level resources that programs may need. In other words, it organises everything to make the operating system run.&lt;br /&gt;
&lt;br /&gt;
It is made of different parts that cannot be moved outside the kernel: the scheduler, the memory pager and the 68k interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
== AmigaDOS: the underlying system ==&lt;br /&gt;
&lt;br /&gt;
The word &amp;quot;DOS&amp;quot; was originally an acronym for &amp;quot;Disk Operating System&amp;quot;. Some say it should be &amp;quot;Disk Based Operating System&amp;quot; as it does a lot more than operate a disk and that it was really an operating system based (stored) on disks.  Some say it should be &amp;quot;Device Operating System&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The whole AmigaDOS system includes things such as:&lt;br /&gt;
&lt;br /&gt;
* A set of commands that can be used in the Shell window and elsewhere.&lt;br /&gt;
* A system for saving data to disk and retrieving it from disk.&lt;br /&gt;
* A system for filing data on disks.&lt;br /&gt;
* An interface for peripherals such as keyboards, monitors, printers, etc.&lt;br /&gt;
* A method of running programs&lt;br /&gt;
* A multitasking system for running more than one program at a time.&lt;br /&gt;
* etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
Read the [[AmigaDOS manual]] to understand and learn everything about AmigaDOS.&lt;br /&gt;
&lt;br /&gt;
== The Graphics library ==&lt;br /&gt;
&lt;br /&gt;
The Graphics library handles every low level graphic operation like designing pixels on the monitor, creating graphic elements (bobs, sprites) and also writing text output.&lt;br /&gt;
&lt;br /&gt;
== Intuition ==&lt;br /&gt;
&lt;br /&gt;
The Intuition library is responsible for every graphical object: windows, screens, gadgets, mouse pointers... It lies between any graphic program and the graphics library.&lt;br /&gt;
&lt;br /&gt;
== The Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench is the graphical place where you will manage your computer and all your files. The name was chosen because the user will use tools to create and work with the computer.&lt;br /&gt;
&lt;br /&gt;
[[File:Wb.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== The Shell ==&lt;br /&gt;
&lt;br /&gt;
While some people prefer to control the operating system using their mouse, others prefer using the keyboard. The shell is a text based window when you can type commands to execute actions in the operating system. In the shell the commands will display the results of their execution.&lt;br /&gt;
&lt;br /&gt;
== ARexx - inter-program communication by scripting ==&lt;br /&gt;
&lt;br /&gt;
The ARexx scripting language can be used to operate the Workbench and other Amiga applications from a script containing ARexx commands. This is extremely useful in performing repetitive tasks or doing what the controlled application was not even designed to do.&lt;br /&gt;
After a learning curve, everybody can use ARexx as it is built into the system.  The scripts can be executed immediately like any other tool.&lt;br /&gt;
&lt;br /&gt;
= How is my data stored? =&lt;br /&gt;
== Files ==&lt;br /&gt;
=== Executable files ===&lt;br /&gt;
Programs you can start are stored in executable files. They contain binary code directly understandable by the computer. They are files with an executable bit, a flag that shows AmigaOS that such file will do something when started.&lt;br /&gt;
An example is a music player. When you start this executable, the player opens and you can start playing music files.&lt;br /&gt;
&lt;br /&gt;
AmigaOS can run two different kinds of executable files: the AmigaOS native programs made for the PowerPC processor and programs created for the Motorola 68k processors. The latter are executed inside an emulation that transcripts them into PowerPC code.&lt;br /&gt;
&lt;br /&gt;
==== Scripts ====&lt;br /&gt;
&lt;br /&gt;
Scripts are text files containing a list of commands.  They are not strictly executables like &#039;&#039;binary code&#039;&#039; files but they can be executed by AmigaOS as if they were.&lt;br /&gt;
This is the case with AmigaDOS and ARexx scripts. These files need to have the executable bit, and the script bit.&lt;br /&gt;
&lt;br /&gt;
=== Data files ===&lt;br /&gt;
Files that are not executable are data files. These contain data that will be manipulated by programs. Some examples are a music file, a video file or a text document.&lt;br /&gt;
&lt;br /&gt;
== Directories/Drawers ==&lt;br /&gt;
In order to organise things, files are grouped together. We create &amp;quot;directories&amp;quot; which are like drawers of a cabinet to store different files of the same kind, for example.  &lt;br /&gt;
Often the name &#039;&#039;directory&#039;&#039; is used when talking about a directory which is stored on a disk. The graphical interface of AmigaOS is called &amp;quot;Workbench,&amp;quot; and directories are often called &#039;&#039;drawers&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Note: directories are often called &#039;&#039;folders&#039;&#039; on other systems.  The terms &amp;quot;directory,&amp;quot; &amp;quot;drawer&amp;quot; and &amp;quot;folder&amp;quot; are synonymous.&lt;br /&gt;
&lt;br /&gt;
== Disks, partitions and volumes ==&lt;br /&gt;
=== Disks ===&lt;br /&gt;
Disks are storage media you can purchase at a computer store. We use them to store our files. They can be internal hard disks, external hard drives, USB interface devices (i.e., SD cards, CF cards, &amp;quot;flash&amp;quot; drives, etc.), and floppy disk drives.&lt;br /&gt;
&lt;br /&gt;
=== Partitions ===&lt;br /&gt;
A disk is often very big and many users prefer to make it more organised. This is done by virtually splitting the disk into several smaller parts. This operation is known as creating partitions on a disk.&lt;br /&gt;
&lt;br /&gt;
[[File:Partitions.png|Small part of Media Toolbox showing different partitions on the harddisk]]&lt;br /&gt;
&lt;br /&gt;
On this screenshot you can see one harddisk with many partitions. Each color corresponds to a different filesystem which defines how data is stored. Also, you can see a greyed area which is a blank area on the disk (i.e., no partition is defined at this position).  Several different file systems can be used on the same Amiga drive.  It&#039;s your choice.&lt;br /&gt;
&lt;br /&gt;
=== Volumes ===&lt;br /&gt;
A partition is a physical area on a disk. To access it with AmigaOS we could read the physical data off the partition. To make it easier AmigaOS uses the concept of volumes. These are virtual representations of a partition. The volumes have a name so AmigaOS and therefore the user can access all files/directories stored on it in a very practical way: just by using its name.&lt;br /&gt;
&lt;br /&gt;
Volume names can refer to either a physical or virtual named space.  See the autodoc section for the ASSIGN command in the C: directory as well as the MOUNT command which provides more information on naming and the concept of volumes.&lt;br /&gt;
&lt;br /&gt;
= How to identify files/directories =&lt;br /&gt;
&lt;br /&gt;
== On the Workbench ==&lt;br /&gt;
&lt;br /&gt;
The Workbench being graphical, a lot of things are understandable just by looking at them. That&#039;s why icons are often enough to understand what kind of object it represents: a file, a directory, a disk...&lt;br /&gt;
&lt;br /&gt;
In case you have a doubt, just look at the information on an icon. The Workbench will tell you the type of the object. It is displayed next to its name.&lt;br /&gt;
&lt;br /&gt;
== In a shell ==&lt;br /&gt;
&lt;br /&gt;
In a shell the &#039;&#039;&#039;list&#039;&#039;&#039; command can be used to see if an object is a file or a directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Files-dirs-in-shell.png|The &#039;&#039;&#039;list&#039;&#039;&#039; command shows a file of 925678 bytes and two directories]]&lt;br /&gt;
&lt;br /&gt;
A file will be displayed with its size, whereas a directory will be displayed with the text &#039;&#039;&#039;Dir&#039;&#039;&#039; next to it.&lt;br /&gt;
&lt;br /&gt;
Also, as you can see on the screenshot, the list command displays other characteristics on these 3 items: the protection bits and the date they were updated the last time. The command also sums up what it just listed.&lt;br /&gt;
&lt;br /&gt;
= All AmigaOS components =&lt;br /&gt;
&lt;br /&gt;
AmigaOS is made of components that are needed as soon as the system starts or later when the user or the system needs them.&lt;br /&gt;
&lt;br /&gt;
== Kickstart modules ==&lt;br /&gt;
&lt;br /&gt;
These components are the heart of AmigaOS. Their duties is to do graphics, to handle discs or to handle all reads/writes to files. Also one of them is the AmigaOS kernel which is a kind of director handling the work of all other components.&lt;br /&gt;
These Kickstart modules are loaded at the beginning of the operating system boot process (read [[UserDoc:How_AmigaOS_Works#AmigaOS_boot_procedure|here]]). You can find all them in the &#039;&#039;&#039;Kickstart&#039;&#039;&#039; directory in the system volume. Here is a list:&lt;br /&gt;
&lt;br /&gt;
=== Mandatory modules ===&lt;br /&gt;
&lt;br /&gt;
The following modules are required in any AmigaOS system. Without one of these, the system will not start.&lt;br /&gt;
&lt;br /&gt;
* kernel - The kernel works like a conductor in an orchestra. Its job is to make everything works together. It creates processes, handle memory usage, defines the way other components will access peripherals...etc. Note that the AmigaOS kernel is not based on any other kernel. It is a self made kernel that works since 1983.&lt;br /&gt;
* loader - this component handles the loading of all other kickstart modules&lt;br /&gt;
* battclock.resource.kmod - this module handles reading/writing the battery backed up clock which is used on all computers to keep the date and time&lt;br /&gt;
* bootimage - this is the boot picture. It is displayed during the start sequence of AmigaOS&lt;br /&gt;
* bootmenu.kmod - this component handles the Early Startup Menu the use can use to define some settings before starting AmigaOS&lt;br /&gt;
* con-handler.kmod - it directs the read and write requests to the console window, to a serial AUX: device or any other supported interface&lt;br /&gt;
* console.device.kmod - it opens a window and reads/writes text to and from that window&lt;br /&gt;
* diskboot.kmod - handles the booting of AmigaOS from a supported disk&lt;br /&gt;
* diskboot.config - this is a text file experienced users can modify to change the boot behaviour of AmigaOS&lt;br /&gt;
* dos.library.kmod - this module is a collection of functions that any program can use to perform actions on disks, files and directories&lt;br /&gt;
* elf.library.kmod - handles the loading of executable programs&lt;br /&gt;
* env-handler.kmod - handles the read/writes of environment variables&lt;br /&gt;
* FileSystem.resource.kmod - handles the use of the different filesystems&lt;br /&gt;
* gadtools.library.kmod - collection of functions used to create all graphic objects like gadgets, sliders, menus...&lt;br /&gt;
* gameport.device.kmod - handles the read/writes of game pads and joysticks&lt;br /&gt;
* graphics.library.kmod - collection of functions used to draw graphic elements on the monitor&lt;br /&gt;
* hunk.library.kmod - set of functions to read a data stream into memory&lt;br /&gt;
* input.device.kmod - handles of input events like keyboard events or mouse clicks&lt;br /&gt;
* intuition.library.kmod - collection of functions to create and handle all graphic elements (screens, windows, the mouse pointer...)&lt;br /&gt;
* layers.library.kmod - set of functions to be used to handle different layers in graphic operations&lt;br /&gt;
* keyboard.device.kmod - driver for the keyboard&lt;br /&gt;
* keymap.library.kmod - functions to handle different keymaps&lt;br /&gt;
* newlib.library.kmod - collection of functions to perform memory operations (allocating memory, copying memory areas... )&lt;br /&gt;
* nonvolatile.library.kmod - provides a simple means for an application developer to manage nonvolatile storage&lt;br /&gt;
* nvram.resource.kmod - handles the read/writes to the EEPROM chip present on many AmigaOS computers&lt;br /&gt;
* PCIGraphics.card - driver that supports the use of different graphic cards&lt;br /&gt;
* ram-handler.kmod - functions that handles the &#039;&#039;&#039;Ram disk:&#039;&#039;&#039; special disk&lt;br /&gt;
* ramdrive.device.kmod - device that allows the usage of the ramdrive device &#039;&#039;&#039;RAD:&#039;&#039;&#039; disk&lt;br /&gt;
* ramlib.kmod - loads disk based libraries and devices for exec.library&lt;br /&gt;
* rtg.library - library of functions to perform lowlevel graphic operations on graphic cards&lt;br /&gt;
* shell.kmod - the AmigaOS command line interface&lt;br /&gt;
* strap.kmod - module that handles booting on different disk devices&lt;br /&gt;
* timer.device.kmod - driver to give access to timing functions&lt;br /&gt;
&lt;br /&gt;
=== Filesystem support ===&lt;br /&gt;
&lt;br /&gt;
These kickstart modules can be loaded or left aside. If you want to use a particular filesystem on your disk partitions, you need to load the corresponding filesystem module.&lt;br /&gt;
&lt;br /&gt;
* CDFileSystem - handles the CD-ROM disks with data stored in different formats: ISO9660, HFS...&lt;br /&gt;
* SmartFilesystem - allows the usage of partitions in SFS0 and SFS2 layouts&lt;br /&gt;
* JXFileSystem - allows the usage of partitions in JXFS layout&lt;br /&gt;
* FastFileSystem - allows the usage of partitions in FFS and FFS2 layouts&lt;br /&gt;
* diskcache.library.kmod - component required by the SmartFileSystem and JXFileSystem modules&lt;br /&gt;
&lt;br /&gt;
=== Hardware drivers ===&lt;br /&gt;
&lt;br /&gt;
==== Graphic cards drivers ====&lt;br /&gt;
&lt;br /&gt;
* 3dfxVoodoo.chip&lt;br /&gt;
* 3DLabsPermedia2.chip&lt;br /&gt;
* ATIRadeon.chip&lt;br /&gt;
* RadeonHD.chip&lt;br /&gt;
* siliconmotion502.chip&lt;br /&gt;
&lt;br /&gt;
==== Disk drivers ====&lt;br /&gt;
&lt;br /&gt;
Each of these drivers allow the use of disks connected to a disk controller. These files are named with the name of the controller they support. As an example, the &#039;&#039;&#039;sii3114ide.device.kmod&#039;&#039;&#039; allows to use disks connected on a &#039;&#039;&#039;Silicon Image SiI3114&#039;&#039;&#039; controller chip.&lt;br /&gt;
&lt;br /&gt;
* it8212ide.device.kmod&lt;br /&gt;
* lsi53c8xx.device.kmod&lt;br /&gt;
* sam460sata.device.kmod&lt;br /&gt;
* sii3112ide.device.kmod&lt;br /&gt;
* sii3512ide.device.kmod&lt;br /&gt;
* sii3114ide.device.kmod&lt;br /&gt;
* sii0680ide.device.kmod&lt;br /&gt;
* sii3132ide.device.kmod&lt;br /&gt;
&lt;br /&gt;
==== USB drivers ====&lt;br /&gt;
&lt;br /&gt;
* hub.usbfd&lt;br /&gt;
* usbsys.device&lt;br /&gt;
* usbresource.library&lt;br /&gt;
* ehci.usbhcd&lt;br /&gt;
* ohci.usbhcd&lt;br /&gt;
* uhci.usbhcd&lt;br /&gt;
* massstorage.usbfd&lt;br /&gt;
&lt;br /&gt;
==== Other drivers ====&lt;br /&gt;
&lt;br /&gt;
* bootkeyboard.usbfd - allows a USB keyboard to be used even before the USB stack is loaded&lt;br /&gt;
* bootmouse.usbfd - allows a USB mouse to be used even before the USB stack is loaded&lt;br /&gt;
* fpga.resource.kmod - allows to use the FPGA components which are present on some Amiga computers&lt;br /&gt;
* i2c.resource.kmod - allows to use the i2c interface present on some Amiga computers&lt;br /&gt;
* xena.resource.kmod - provides access to the Xena chip on the AmigaOne X1000&lt;br /&gt;
&lt;br /&gt;
=== Misc modules ===&lt;br /&gt;
&lt;br /&gt;
* petunia.library.kmod - this module contains the Just-In-Time emulator that allows AmigaOS to run programs made for the Motorola 68k processor&lt;br /&gt;
&lt;br /&gt;
=== Control of the Kickstart ===&lt;br /&gt;
&lt;br /&gt;
The Kickstart/ drawer contains an ASCII file called &amp;quot;Kicklayout&amp;quot;. This file lists all the modules that must be loaded from the system volume during the boot process. It is read by the boot loaders &amp;quot;SLB&amp;quot; or &amp;quot;amigaboot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The Kicklayout file consists of a number of configurations, each of which describes a set of Kickstart modules. Each configuration has a label and the various configurations are listed by label on the boot screen. The user may elect to allow the default configuration or to select any one of the available configurations. Often a developer may have several configurations in his/her Kicklayout file, some of which may be experimental, while the default is a &amp;quot;known good&amp;quot; configuration to which (s)he can fall back.&lt;br /&gt;
&lt;br /&gt;
You can edit the Kicklayout file using Notepad or any other ASCIII editor. You are strongly advised to leave the original configuration unchanged (as a fall-back) and to add new configurations at the end of the file, each with its own label. That way you can still recover if you make a mistake while editing.&lt;br /&gt;
&lt;br /&gt;
The individual configurations are headed by lines like these:&lt;br /&gt;
; Configuration name&lt;br /&gt;
LABEL DefaultSystem&lt;br /&gt;
; Exec name&lt;br /&gt;
EXEC Kickstart/loader.of&lt;br /&gt;
;&lt;br /&gt;
; PPC native modules&lt;br /&gt;
;&lt;br /&gt;
MODULE Kickstart/kernel&lt;br /&gt;
(etc)&lt;br /&gt;
&lt;br /&gt;
Note that lines that start with a semicolon (&amp;quot;;&amp;quot;) are treated as comments and are ignored. Each configuration must start with a &amp;quot;LABEL&amp;quot; and should be separated from the previous configuration by a blank line.&lt;br /&gt;
&lt;br /&gt;
Each module to be loaded is defined by the &amp;quot;MODULE&amp;quot; keyword, followed by the path and file name. You can use any path &#039;&#039;&#039;on the system volume&#039;&#039;&#039;, so you could have two or more drawers containing Kickstart modules and address them independently if you so wished. You can not refer to modules on other volumes, since they have not been mounted by DOS (which does not exist yet) and only the system volume is available at this early stage.&lt;br /&gt;
&lt;br /&gt;
=== Selecting the Default Configuration ===&lt;br /&gt;
&lt;br /&gt;
You can specify in the NVRAM the label of the default configuration in the Kicklayout. For instance, if your default configuration is called &amp;quot;MainSystem&amp;quot;, the LABEL line will look like this:&lt;br /&gt;
&lt;br /&gt;
LABEL MainSystem&lt;br /&gt;
&lt;br /&gt;
You can define an NVRAM variable called &amp;quot;boot_config&amp;quot; using U-Boot, CFE or the &amp;quot;nvsetvar&amp;quot; tool. Simply type:&lt;br /&gt;
&lt;br /&gt;
nvsetvar boot_config &amp;quot;MainSystem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Note that nvsetvar may be inhibited from writing to the NVRAM on some systems, in which case you will have to use U-Boot or CFE to set the variable]&lt;br /&gt;
&lt;br /&gt;
== System components ==&lt;br /&gt;
&lt;br /&gt;
[[File:Workbench_directory_listing.png|frame|right|List of directories and files present at the root of any AmigaOS system]]&lt;br /&gt;
&lt;br /&gt;
Beside the kickstart modules, AmigaOS uses many different components that can be loaded only when used. These files are stored in different directories in the system volume.&lt;br /&gt;
Here is described a default AmigaOS installation.&lt;br /&gt;
&lt;br /&gt;
* C&lt;br /&gt;
This directory contains AmigaDOS &#039;&#039;&#039;C&#039;&#039;&#039;ommands&lt;br /&gt;
* Classes&lt;br /&gt;
contains different object elements easy to be used in any program: gadgets, requesters, graphic table, windows...&lt;br /&gt;
* Devs&lt;br /&gt;
contains definition for &#039;&#039;&#039;Dev&#039;&#039;&#039;ices&lt;br /&gt;
* Emulation&lt;br /&gt;
contains files used for the 68k emulation (though E-UAE)&lt;br /&gt;
* Fonts&lt;br /&gt;
contains various systems fonts&lt;br /&gt;
* Internet&lt;br /&gt;
contains a dialer to connect to Internet&lt;br /&gt;
* Kickstart&lt;br /&gt;
contains the kickstart modules&lt;br /&gt;
* L&lt;br /&gt;
contains hand&#039;&#039;&#039;l&#039;&#039;&#039;ers and filesystems&lt;br /&gt;
* Libs&lt;br /&gt;
contains dynamic &#039;&#039;&#039;Libr&#039;&#039;&#039;airies of functions&lt;br /&gt;
* Locale&lt;br /&gt;
contains all files used to localise the system (catalogs, keymaps...)&lt;br /&gt;
* MUI&lt;br /&gt;
contains the needed files for programs that use the MUI third party graphic interface&lt;br /&gt;
* [[Prefs]]&lt;br /&gt;
contains the preference programs used to customise AmigaOS&lt;br /&gt;
* S&lt;br /&gt;
contains the &#039;&#039;&#039;S&#039;&#039;&#039;cripts&lt;br /&gt;
* SObjs&lt;br /&gt;
contains .so shared object library files&lt;br /&gt;
* Storage&lt;br /&gt;
contains other optional files&lt;br /&gt;
* System&lt;br /&gt;
contains some programs used by the system itself (i.e. you don&#039;t need to run them yourself) or low-level programs like disk tools&lt;br /&gt;
* [[Utilities]]&lt;br /&gt;
contains several programs you can use to achieve some tasks on AmigaOS&lt;br /&gt;
&lt;br /&gt;
= Motorola 680x0 Emulators =&lt;br /&gt;
&lt;br /&gt;
For a long time Amigas have had the famous Motorola 680x0 processors as the central unit for execution. Unfortunately the time of the 680x0 series is passing in favor of other architectures. The new era of processors reached the Amiga some time ago, when expansion boards became available for extending the Classic systems with the raw power of a PowerPC processor.&lt;br /&gt;
&lt;br /&gt;
In the old operating system (AmigaOS 3.x) it was not possible to gain the full advantage of the new processors. The system itself and most of the applications required the original Motorola 680x0 processor. There was no 680x0 emulation available for the PowerPCs, so the 680x0 could not be &amp;quot;switched off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Thus the new processors remained as a powerful, but mostly unused adjunct to the main 680x0 processor. &amp;quot;Native&amp;quot; PowerPC programs were rare, and every time a PowerPC program called the system, a so called &amp;quot;context switch&amp;quot; occurred between the 680x0 and PowerPC code, often causing a large performance penalty.&lt;br /&gt;
&lt;br /&gt;
The new Amiga platform is based on the PowerPC processor family, therefore the new version of the AmigaOS has to smooth the transition from the 680x0 series, which is achieved by emulating the old processor architecture. The operating system itself is written almost 100 percent for the PowerPC processors, but the 680x0 legacy applications require an emulated 680x0 processor. &lt;br /&gt;
&lt;br /&gt;
== Two 680x0 Emulators ==&lt;br /&gt;
&lt;br /&gt;
In version 4.0 of AmigaOS, two different emulators were implemented; one is the successor of BlackBox emulation, it is an interpretive emulator, thus the emulation speed is mediocre. On the other hand it has a very low &amp;quot;reaction time&amp;quot;, and is ideal for time critical parts, such as interrupts.&lt;br /&gt;
&lt;br /&gt;
The other is Petunia, the &amp;quot;JIT emulator&amp;quot;. A fast, but less compatible way of emulation of the legacy Motorola processors. It is intended mainly for emulating applications, and therefore, when execution of the application leaves the bounds of the application&#039;s code segment, emulation falls back to the interpretive method, where it does its job and returns to the JIT emulation again.&lt;br /&gt;
&lt;br /&gt;
Dynamic recompilation (also called just-in-time compilation or simply JIT compilation) is a technique of translating foreign processor machine code to native machine code, &amp;quot;on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This technique is common nowadays, commonly applied in JAVA virtual machines, and it is also used with success in several emulators. In dynamic recompilation there is the possibility of runtime optimization of the emulated code by collecting statistics of the execution process. Therefore (theoretically) the final executed code can be even faster than the original code on its original processor.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Emulated opcodes:&lt;br /&gt;
* all user and supervisor level opcodes of the Motorola 68040&lt;br /&gt;
* all FPU opcodes of the Motorola 68881/68882 &lt;br /&gt;
&lt;br /&gt;
AmigaOS claims only 68020/68881 compatibility to applications because this is the safest compatibility level, but both emulators are compatible with the machine code up to the level of 68040/060 processors.&lt;br /&gt;
&lt;br /&gt;
At compile time, a low level flag and branch control analysis allows on-the-fly optimizations of compiled code.&lt;br /&gt;
&lt;br /&gt;
== Removing the JIT Emulator ==&lt;br /&gt;
&lt;br /&gt;
Using the dynamic translation requires a lot more memory than the interpretive emulation. The translated code needs to be stored somewhere, not to mention the data collection tables.&lt;br /&gt;
&lt;br /&gt;
If speed is not as important as the memory consumption of the system, then the JIT emulator can be removed, leaving the job to the interpretive emulator.&lt;br /&gt;
&lt;br /&gt;
Thanks to the modular design of AmigaOS kickstart, all you need to do is edit the &amp;quot;Sys:Kickstart/Kicklayout&amp;quot; file, simply put a semicolon (;) at the beginning of the module line of Petunia.library.kmod. After rebooting the system from cold, the JIT emulator will not be reloaded. Make sure that you alter the appropriate configuration in the Kicklayout file, there may be several alternative configurations, with different names like &amp;quot;DefaultJIT&amp;quot;, or &amp;quot;DefaultNoJIT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Emulators ==&lt;br /&gt;
&lt;br /&gt;
Petunia cooperates with a so called &amp;quot;black list&amp;quot;. By default Petunia emulates every 680x0 program or library that is loaded by DOS.library/LoadSeg function, but if an executable or library shows incompatibilities with Petunia, then it can be explicitly inhibited from the dynamic recompilation by specifying it in a list file.&lt;br /&gt;
&lt;br /&gt;
If an executable needs to be added to the list, then it can be done by extending the file &amp;quot;DEVS:applications.dos&amp;quot; with the &#039;&#039;&#039;Compatibility&#039;&#039;&#039; preferences program from the Prefs drawer of the system. Adding a program name to the list and checking it will prevent Petunia from emulating that program, and it will be interpreted instead by the built-in interpreter.&lt;br /&gt;
&lt;br /&gt;
Removing a program from the list or unchecking (thus allowing Petunia to emulate it again) can be done with the same preferences program.&lt;br /&gt;
&lt;br /&gt;
Please note: some programs consist of multiple executables (shared libraries, plugins). If you want to fully disable the translation of such programs, then every part must be added to the list.&lt;br /&gt;
&lt;br /&gt;
For example to disable UnArc fully, you would have to add all files from libs:xad and also xadmaster.library to the list. &lt;br /&gt;
&lt;br /&gt;
= AmigaOS boot procedure =&lt;br /&gt;
&lt;br /&gt;
Basically a computer with AmigaOS does the following when the power button is pushed:&lt;br /&gt;
&lt;br /&gt;
* [[File:Uboot.jpg|200px]]&lt;br /&gt;
the BIOS ([[UserDoc:BIOS|Uboot]] or [[UserDoc:BIOS|CFE]]) of the computer initialises the hardware: graphic card, USB ports... At this point, the monitor wakes up and the first information are displayed. This allows to see if hardware is correctly recognised. As an example you can see if a hard drive is correctly connected into the machine and your BIOS is correctly setup to make this drive useable.&lt;br /&gt;
* depending on how you setup the BIOS it will look on the harddisk to find the Second Level Booter (SLB). This program is stored on the first sectors of the disk. Whereas the BIOS does not know about AmigaOS disk structure, the SLB will be able to &#039;&#039;understand&#039;&#039; the AmigaOS partitions and files. In other words, it is the link between the BIOS and the rest of the boot procedure. Its goal is also to give you the ability to start several configurations present on the same drive.&lt;br /&gt;
* [[File:SLB.png|200px]]&lt;br /&gt;
the SLB will analyses all Amiga partitions on the disk it is installed on. It will read each [[UserDoc:kickstart_configuration|system configuration]] it finds on the partitions. It will show all available configurations for the user to select one to load.&lt;br /&gt;
The user can define many different kickstart configurations to choose from. Also both AmigaOS and Linux can be selected for boot.&lt;br /&gt;
* [[File:Kmods loading.png|200px]]&lt;br /&gt;
the SLB loads the kickstart files of the selected configuration and executes the &#039;&#039;&#039;Loader&#039;&#039;&#039; module&lt;br /&gt;
* &#039;&#039;&#039;Loader&#039;&#039;&#039; executes the kickstart modules (Exec, devices, libraries...)&lt;br /&gt;
* AmigaOS becomes alive displaying the AmigaOS boot picture on the monitor&lt;br /&gt;
* the AmigaDOS library executes the [[UserDoc:System_Scripts#startup-sequence|startup-sequence]] script found on the system volume&lt;br /&gt;
* the Startup-sequence will be executed and all commands it contains are executed. It means that starting from here the boot procedure is easy to follow and understand.&lt;br /&gt;
* the Workbench is started&lt;br /&gt;
&lt;br /&gt;
At this point the user can use his/her computer.&lt;br /&gt;
&lt;br /&gt;
= How to make a Bootable USB Memory Stick for AmigaOS 4.1 =&lt;br /&gt;
&lt;br /&gt;
By Julian Margetson (&amp;quot;Spectre660&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
* USB memory stick of 2 GB or less in size.&lt;br /&gt;
* It is best to only have one USB mass storage device connected while you are creating your bootable USB memory stick.&lt;br /&gt;
* Plug the USB memory stick into a USB port on your machine.&lt;br /&gt;
* Note that the device will be formatted so make sure that you use an empty memory stick or one that does not contain any data that you need or backup the contents before you begin.&lt;br /&gt;
&lt;br /&gt;
Procedure:&lt;br /&gt;
# You use Media Toolbox in the System: drawer to prepare the USB stick. On starting Media Toolbox select &#039;&#039;usbdisk.device&#039;&#039; as the device to use.&lt;br /&gt;
# Make certain that you have selected usbdisk.device and not any other device.&lt;br /&gt;
# Click on &amp;quot;Start&amp;quot;&lt;br /&gt;
# You will see the usb mass storage unit connected in a list.&lt;br /&gt;
# Make sure that the Unit type displayed for the USB memory stick is &amp;quot;Removable hard disk&amp;quot;&lt;br /&gt;
# Select that Unit by clicking on it.&lt;br /&gt;
# The first thing that you need to do is to install the RDB onto the USB Memory Stick.&lt;br /&gt;
# Click on the  &amp;quot;Install&amp;quot; button.&lt;br /&gt;
# A window Labeled &amp;quot;RDB/disk geometry editing&amp;quot; comes up.&lt;br /&gt;
## Towards the bottom of the window is the &amp;quot;AmigaOne boot code (SLB)&amp;quot; section.&lt;br /&gt;
## Select the &amp;quot;Install&amp;quot; button .&lt;br /&gt;
## A file requester  &amp;quot;Select AmigaOne Boot Code&amp;quot; now comes  up with the Drawer choice defaulting to &amp;quot;l:&amp;quot;&lt;br /&gt;
## Select file &amp;quot;slb_v2&amp;quot;. &lt;br /&gt;
## Select Ok.&lt;br /&gt;
## You are now returned to the &amp;quot;RDB/disk geometry editing window&amp;quot;.&lt;br /&gt;
## Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
# You are now returned to the display showing the attached USB unit.&lt;br /&gt;
# Select &amp;quot;Edit partitions and Filesystems&amp;quot;. You will now see the Window &#039;Editing partitions for disk&amp;quot;&lt;br /&gt;
# Select &amp;quot;Add partition&amp;quot;&lt;br /&gt;
# This defaults to using the whole device as a single partition.&lt;br /&gt;
# It is possible to use create more partitions but for this tutorial we will only use one.&lt;br /&gt;
# You now need to give the partition a unique name (e.g. USB0 or something that is different from any of the existing partitions on your hard drive). This is done by changing the default DH0 in the &amp;quot;Name&amp;quot; box.&lt;br /&gt;
# Now make sure that the Boxes &amp;quot;Automount&amp;quot; and &amp;quot;Bootable&amp;quot; are  selected and show the &amp;quot;Tick mark&amp;quot;.&lt;br /&gt;
# You need to set &amp;quot;Boot priority&amp;quot; to higher than the boot priority of your hard drive boot partition(s). This is done by increasing Boot priority by clicking on the &amp;quot;+&amp;quot; to the right of the &amp;quot;boot priority&amp;quot; box. Normally you can set the boot priority to 2 .&lt;br /&gt;
# Next it is time to select the file system to use.&lt;br /&gt;
# Select &amp;quot;Select filesystem/edit details&amp;quot;.&lt;br /&gt;
# The Window &amp;quot;Editing details for partition &#039;USB0&#039;&amp;quot;  ,or whatever partition name you used, comes up.&lt;br /&gt;
## Select the file system that you are going to use by selecting the pull down menu under &amp;quot;Filesystem chooser&amp;quot;.&lt;br /&gt;
## Only filesystems SFS/00 or SFS/02 will work for a bootable device.&lt;br /&gt;
## The option that gives the most flexibility at the moment is SFS/00 as a USB stick in this format can be read and written to using another compatible system in the event that you need to make modifications after it is created without a booting AmigaOS 4.1 machine.&lt;br /&gt;
## Next select Blocksize from the &amp;quot;Blocksize&amp;quot; pull down menu. 512 is the correct size to use.&lt;br /&gt;
## Now Select &amp;quot;Ok-accept changes&amp;quot;.&lt;br /&gt;
## Your are now returned to the &amp;quot;Edit partitions for disk&amp;quot; window.&lt;br /&gt;
## Again select &amp;quot;Ok-accept changes&amp;quot;&lt;br /&gt;
# You are now returned to the window showing the USB mass storage unit list.&lt;br /&gt;
# Select &amp;quot;Save to disk&amp;quot;&lt;br /&gt;
# A requester pops up with the options &amp;quot;Yes, Save.&amp;quot; or &amp;quot;No!&amp;quot;&lt;br /&gt;
# Select the &amp;quot;Yes, save.&amp;quot; option.&lt;br /&gt;
# You now close Media Toolbox by clicking on the close icon (X) on the left of the Media Toolbox window.&lt;br /&gt;
# This will give you a requester advising that you need to reboot the machine for the changes to take effect. At this point you need to remove the USB memory stick for the machine. If you do not then the Machine will attempt boot from it before it is formatted and the required Kickstart and AmigaOS 4.1 files are copied to it.&lt;br /&gt;
# Select &amp;quot;Yes, reboot NOW!&amp;quot;.&lt;br /&gt;
# Once you have rebooted connect your USB Memory Stick to a USB port.&lt;br /&gt;
# A disk icon &amp;quot;USB0:Uninitialized&amp;quot; (or whatever partition name you used) appears on Workbench.&lt;br /&gt;
# You now need to format the device.&lt;br /&gt;
# To format Select this Icon and go to the Workbench &amp;quot;Icons&amp;quot; menu .&lt;br /&gt;
# Select &amp;quot;Format Disk&amp;quot;&lt;br /&gt;
# You can give the USB Memory Stick a unique name and  select whether you want a Trashcan or not.&lt;br /&gt;
# You can use either a full Format or a  Quick Format. Full Format may take a few minutes.&lt;br /&gt;
# Once formatted the USB Memory Stick is ready for you to copy the required files from you hard drive or AmigaOS Install CD to it in order to boot AmigaOS 4.1 from it.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=Programming_AmigaOS_4:_Datatypes_-_Making_Life_Easy&amp;diff=9193</id>
		<title>Programming AmigaOS 4: Datatypes - Making Life Easy</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=Programming_AmigaOS_4:_Datatypes_-_Making_Life_Easy&amp;diff=9193"/>
		<updated>2017-08-24T23:14:51Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos in paths, para under heading &amp;quot;DataTypes Internally&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;This article was adapted from Amiga Future magazine&#039;s series on developing for AmigaOS....&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Although the Datatypes haven&#039;t really been changed or reworked in AmigaOS 4, they should however still be he given some attention in the context of this workshop, because they can make the life of the programmer significantly easier.&lt;br /&gt;
&lt;br /&gt;
Datatypes are an ingenious concept, unlike anything found on other platforms in this form. The specific program requires a file of a certain datatype (such as; images, sound, text) and the operating system automatically takes care of changing the format to the required one on the harddrive, at least when there is an interpreter available.&lt;br /&gt;
&lt;br /&gt;
The main groups that exist are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| GID_SYSTEM || (syst) || System-Files&lt;br /&gt;
|-&lt;br /&gt;
| GID_TEXT || (text) || ASCII-Text&lt;br /&gt;
|-&lt;br /&gt;
| GID_DOCUMENT || (docu) || Document (Text and Graphics)&lt;br /&gt;
|-&lt;br /&gt;
| GID_SOUND || (soun) || Sound/Sample&lt;br /&gt;
|-&lt;br /&gt;
| GID_INSTRUMENT || (inst) || Music instrument&lt;br /&gt;
|-&lt;br /&gt;
| GID_MUSIC || (musi) || Music&lt;br /&gt;
|-&lt;br /&gt;
| GID_PICTURE || (pict) || Single Image&lt;br /&gt;
|-&lt;br /&gt;
| GID_ANIMATION || (anim) || multiple Images/Animation&lt;br /&gt;
|-&lt;br /&gt;
| GID_MOVIE || (movi) || Animation with graphics and Sound&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the application there should ideally be a rough preliminary check, because in a painting program there will surely be nothing to show for a music file. A conversion of sound into note signs doesn&#039;t exist yet, but could be an interesting application. :-)&lt;br /&gt;
&lt;br /&gt;
= The first step =&lt;br /&gt;
&lt;br /&gt;
The simplest function available in the datatype.library is determining of the datatype and respectively the datatype concerning the file. The function IDataTypes-&amp;gt;ObtainDataType() expects a Taglist, which in the simplest of cases should only contain the name of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  if((lock = IDOS-&amp;gt;Lock(&amp;quot;dateiname&amp;quot;,SHARED_LOCK)))&lt;br /&gt;
  {&lt;br /&gt;
    if((dtn = IDataTypes-&amp;gt;ObtainDataType(DTST_FILE, (APTR) lock, TAG_END)))&lt;br /&gt;
    {&lt;br /&gt;
      ...&lt;br /&gt;
      IDataTypes-&amp;gt;ReleaseDataType(dtn);&lt;br /&gt;
    }&lt;br /&gt;
    IDOS-&amp;gt;UnLock(lock);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, that leads us right into the first example program &amp;quot;GetFileType.c&amp;quot;, which can be given a file and returns the format type as a result. In case AmigaOS can&#039;t do anything with this file it returns &amp;quot;Object not found&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* GetFileType.c&lt;br /&gt;
 *&lt;br /&gt;
 * gcc GetFileType.c -o GetFileType -l auto&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/******************************* INCLUDES *************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;proto/exec.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/datatypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/iffparse.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
uint32 GetTyp(STRPTR filename)&lt;br /&gt;
{&lt;br /&gt;
  uint32 typ = 0;&lt;br /&gt;
  BPTR lock;&lt;br /&gt;
  struct DataType *dtn;&lt;br /&gt;
  uint8 buffer[5];&lt;br /&gt;
&lt;br /&gt;
  if((lock = IDOS-&amp;gt;Lock(filename, SHARED_LOCK)))&lt;br /&gt;
  {&lt;br /&gt;
    if((dtn = IDataTypes-&amp;gt;ObtainDataType(DTST_FILE, (APTR) lock, TAG_END)))&lt;br /&gt;
    {&lt;br /&gt;
      const struct DataTypeHeader *dth = dtn-&amp;gt;dtn_Header;&lt;br /&gt;
&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;   Filename: %s\n&amp;quot;, filename);&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;Description: %s\n&amp;quot;, dth-&amp;gt;dth_Name);&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;  Base Name: %s\n&amp;quot;, dth-&amp;gt;dth_BaseName);&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;       Type: %s\n&amp;quot;, IDataTypes-&amp;gt;GetDTString((dth-&amp;gt;dth_Flags &amp;amp; DTF_TYPE_MASK) + DTMSG_TYPE_OFFSET));&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;      Group: %s\n&amp;quot;, IDataTypes-&amp;gt;GetDTString(dth-&amp;gt;dth_GroupID));&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;         ID: %s\n&amp;quot;, IIFFParse-&amp;gt;IDtoStr(dth-&amp;gt;dth_ID,buffer));&lt;br /&gt;
&lt;br /&gt;
      typ = dth-&amp;gt;dth_GroupID;&lt;br /&gt;
&lt;br /&gt;
      IDataTypes-&amp;gt;ReleaseDataType(dtn);&lt;br /&gt;
    }&lt;br /&gt;
    else IDOS-&amp;gt;PrintFault(IDOS-&amp;gt;IoErr(), filename);&lt;br /&gt;
    IDOS-&amp;gt;UnLock(lock);&lt;br /&gt;
  }&lt;br /&gt;
  else IDOS-&amp;gt;PrintFault(IDOS-&amp;gt;IoErr(), filename);&lt;br /&gt;
&lt;br /&gt;
  return typ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  if(argc &amp;gt;= 2) GetTyp(argv[1]);&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:AF109_getfiletype_grab.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
= Here with the file! =&lt;br /&gt;
&lt;br /&gt;
In order to actually get the file we also have to use another function with the name IDataTypes-&amp;gt;NewDTObject(). This can even be given the name of the file directly (including path), as well as other parameters with Taglist. In case of an error it returns NULL, otherwise an object which have to be released again at the end with IDataTypes-&amp;gt;DisposeDTObject().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  if((dtobj = IDataTypes-&amp;gt;NewDTObject(&amp;quot;sample&amp;quot;,&lt;br /&gt;
                                     DTA_SourceType,  DTST_FILE,&lt;br /&gt;
                                     DTA_GroupID,     GID_SOUND,&lt;br /&gt;
                                     TAG_END)))&lt;br /&gt;
  {&lt;br /&gt;
    ...&lt;br /&gt;
    IDataTypes-&amp;gt;DisposeDTObject(dtobj);&lt;br /&gt;
  } &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Merely displaying the file is something which can be handled by the Datatype as well. AddDTObject(), RefreshDTObjects() and RemoveDTObject() take care of this task. For playing back however the Play-Method must be executed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IIntuition-&amp;gt;IDoMethod(dt,DTM_TRIGGER,NULL,STM_PLAY,NULL);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually however you will want to process the file in your own application. In that case IDataTypes-&amp;gt;GetDTAttrs(), with which you can request the values, image or sound data for example, will help you along. This time there are two examples concluding this theme: with &amp;quot;ShowPic.c&amp;quot; you can display an image and with &amp;quot;PlaySample.c&amp;quot; you can play back a sample file.&lt;br /&gt;
&lt;br /&gt;
== ShowPic Example  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* ShowPic.c&lt;br /&gt;
 *&lt;br /&gt;
 * gcc ShowPic.c -o ShowPic -l auto&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/******************************* INCLUDES *************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;exec/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;dos/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;dos/rdargs.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/datatypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/datatypesclass.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/pictureclass.h&amp;gt;&lt;br /&gt;
#include &amp;lt;intuition/intuition.h&amp;gt;&lt;br /&gt;
#include &amp;lt;intuition/icclass.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;proto/exec.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/datatypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/graphics.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/intuition.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/utility.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
#define OPT_NAME 0&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void PrintErrorMsg (ULONG errnum, STRPTR name)&lt;br /&gt;
{&lt;br /&gt;
  TEXT errbuff[80];&lt;br /&gt;
&lt;br /&gt;
  if(errnum &amp;gt;= DTERROR_UNKNOWN_DATATYPE)&lt;br /&gt;
  {&lt;br /&gt;
    /* Datatypes eigener Fehlercode auswerten */&lt;br /&gt;
    IUtility-&amp;gt;SNPrintf(errbuff,sizeof(errbuff),IDataTypes-&amp;gt;GetDTString(errnum),name);&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    /* allgemeinen Fehlertext eintragen */&lt;br /&gt;
    IDOS-&amp;gt;Fault(errnum,NULL,errbuff,sizeof(errbuff));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  IDOS-&amp;gt;Printf(&amp;quot;%s\nerror #%ld\n&amp;quot;,errbuff,errnum);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  uint32 options[1] = {0};&lt;br /&gt;
  struct RDArgs *rdargs;&lt;br /&gt;
&lt;br /&gt;
  if((rdargs = IDOS-&amp;gt;ReadArgs(&amp;quot;NAME/A&amp;quot;,(LONG *)options,NULL)))&lt;br /&gt;
  {&lt;br /&gt;
    Object *dto;&lt;br /&gt;
&lt;br /&gt;
    /* Datatypes Objekt ermitteln */&lt;br /&gt;
    if((dto = IDataTypes-&amp;gt;NewDTObject((APTR)options[OPT_NAME],&lt;br /&gt;
                                      DTA_SourceType, DTST_FILE,&lt;br /&gt;
                                      DTA_GroupID,    GID_PICTURE,&lt;br /&gt;
                                      PDTA_DestMode,  PMODE_V43,   /* Wichtig: 43er Modus aktivieren fÂ¸r 24 Bit Verarbeitung */&lt;br /&gt;
                                      TAG_END)))&lt;br /&gt;
    {&lt;br /&gt;
      ULONG nomwidth, nomheight;&lt;br /&gt;
&lt;br /&gt;
      /* Informationen Â¸ber das Objekt erfragen */&lt;br /&gt;
      if((IDataTypes-&amp;gt;GetDTAttrs(dto,&lt;br /&gt;
            DTA_NominalHoriz, &amp;amp;nomwidth,&lt;br /&gt;
            DTA_NominalVert,  &amp;amp;nomheight,&lt;br /&gt;
            TAG_END)))&lt;br /&gt;
      {&lt;br /&gt;
        /* Anzeigen der Datei und dessen GrËï¬e */&lt;br /&gt;
        IDOS-&amp;gt;Printf(&amp;quot;%s %ld x %ld pixels\n&amp;quot;,&lt;br /&gt;
          options[OPT_NAME], nomwidth, nomheight);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      /* Umgebungsdaten verarbeiten */&lt;br /&gt;
      struct dtFrameBox dtf = {0};&lt;br /&gt;
      struct FrameInfo  fri = {0};&lt;br /&gt;
      dtf.MethodID          = DTM_FRAMEBOX;&lt;br /&gt;
      dtf.dtf_FrameInfo     = &amp;amp;fri;&lt;br /&gt;
      dtf.dtf_ContentsInfo  = &amp;amp;fri;&lt;br /&gt;
      dtf.dtf_SizeFrameInfo = sizeof(struct FrameInfo);&lt;br /&gt;
      if(!(IDataTypes-&amp;gt;DoDTMethodA(dto,NULL,NULL,(Msg)&amp;amp;dtf)))&lt;br /&gt;
        IDOS-&amp;gt;Printf(&amp;quot;could not obtain environment information\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
      /* sicherstellen, dass eine GrËï¬e vorhanden ist */&lt;br /&gt;
      nomwidth  = ((nomwidth) ? nomwidth : 600);&lt;br /&gt;
      nomheight = ((nomheight) ? nomheight : 200);&lt;br /&gt;
&lt;br /&gt;
      /* Fenster Ëffnen */&lt;br /&gt;
      struct Window *win;&lt;br /&gt;
      if((win = IIntuition-&amp;gt;OpenWindowTags(NULL,&lt;br /&gt;
                 WA_InnerWidth,    nomwidth,&lt;br /&gt;
                 WA_InnerHeight,   nomheight,&lt;br /&gt;
                 WA_Title,         options[OPT_NAME],&lt;br /&gt;
                 WA_IDCMP,         IDCMP_CLOSEWINDOW | IDCMP_VANILLAKEY | IDCMP_IDCMPUPDATE,&lt;br /&gt;
                 WA_DragBar,       TRUE,&lt;br /&gt;
                 WA_DepthGadget,   TRUE,&lt;br /&gt;
                 WA_CloseGadget,   TRUE,&lt;br /&gt;
                 WA_AutoAdjust,    TRUE,&lt;br /&gt;
                 WA_SimpleRefresh, TRUE,&lt;br /&gt;
                 WA_BusyPointer,   TRUE,&lt;br /&gt;
                 WA_Activate,      TRUE,&lt;br /&gt;
                 TAG_END)))&lt;br /&gt;
      {&lt;br /&gt;
        /* Die GrËï¬e fÂ¸r das Datatypes Objekt setzen */&lt;br /&gt;
        IDataTypes-&amp;gt;SetDTAttrs(dto,NULL,NULL,&lt;br /&gt;
            GA_Left,    win-&amp;gt;BorderLeft,&lt;br /&gt;
            GA_Top,     win-&amp;gt;BorderTop,&lt;br /&gt;
            GA_Width,   win-&amp;gt;Width - win-&amp;gt;BorderLeft - win-&amp;gt;BorderRight,&lt;br /&gt;
            GA_Height,  win-&amp;gt;Height - win-&amp;gt;BorderTop - win-&amp;gt;BorderBottom,&lt;br /&gt;
            ICA_TARGET, ICTARGET_IDCMP,&lt;br /&gt;
            TAG_END);&lt;br /&gt;
&lt;br /&gt;
        /* Das Datatype Objekt ins Fenster einhâ°ngen */&lt;br /&gt;
        IDataTypes-&amp;gt;AddDTObject(win,NULL,dto,-1);&lt;br /&gt;
&lt;br /&gt;
        /* einen Refresh des Datatypes Objekts auslËsen, */&lt;br /&gt;
        /* damit es im Programmkontext gezeichnet wird */&lt;br /&gt;
        IDataTypes-&amp;gt;RefreshDTObjects(dto,win,NULL,NULL);&lt;br /&gt;
&lt;br /&gt;
        BOOL going = TRUE;&lt;br /&gt;
        while(going)&lt;br /&gt;
        {&lt;br /&gt;
          /* warten auf ein Ereignis */&lt;br /&gt;
          ULONG signal = IExec-&amp;gt;Wait((1 &amp;lt;&amp;lt; win-&amp;gt;UserPort-&amp;gt;mp_SigBit) | SIGBREAKF_CTRL_C);&lt;br /&gt;
&lt;br /&gt;
          /* bei Benutzerabbruch das Programm beenden */&lt;br /&gt;
          if(signal &amp;amp; SIGBREAKF_CTRL_C) going = FALSE;&lt;br /&gt;
&lt;br /&gt;
          /* alle Nachrichten von Intuition verarbeiten */&lt;br /&gt;
          struct IntuiMessage *imsg;&lt;br /&gt;
          while((imsg = (struct IntuiMessage *) IExec-&amp;gt;GetMsg(win-&amp;gt;UserPort)))&lt;br /&gt;
          {&lt;br /&gt;
            struct TagItem *tstate, *tag, *tags;&lt;br /&gt;
            ULONG tidata;&lt;br /&gt;
&lt;br /&gt;
            /* die einzelnen Nachrichten verarbeiten */&lt;br /&gt;
            switch(imsg-&amp;gt;Class)&lt;br /&gt;
            {&lt;br /&gt;
              case IDCMP_CLOSEWINDOW:&lt;br /&gt;
                   going = FALSE;&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case IDCMP_VANILLAKEY:&lt;br /&gt;
                   if(imsg-&amp;gt;Code == 27 /* ESC-Taste */) going = FALSE;&lt;br /&gt;
                   break;&lt;br /&gt;
&lt;br /&gt;
              case IDCMP_IDCMPUPDATE:&lt;br /&gt;
                   tstate = tags = (struct TagItem *) imsg-&amp;gt;IAddress;&lt;br /&gt;
                   while(tag = IUtility-&amp;gt;NextTagItem (&amp;amp;tstate))&lt;br /&gt;
                   {&lt;br /&gt;
                     tidata = tag-&amp;gt;ti_Data;&lt;br /&gt;
                     switch(tag-&amp;gt;ti_Tag)&lt;br /&gt;
                     {&lt;br /&gt;
                       /* Wartezeiger anzeigen bzw. wegnehmen */&lt;br /&gt;
                       case DTA_Busy:&lt;br /&gt;
                            if(tidata)&lt;br /&gt;
                              IIntuition-&amp;gt;SetWindowPointer(win,WA_BusyPointer,TRUE,TAG_END);&lt;br /&gt;
                            else&lt;br /&gt;
                              IIntuition-&amp;gt;SetWindowPointer(win,WA_Pointer,NULL,TAG_END);&lt;br /&gt;
                            break;&lt;br /&gt;
&lt;br /&gt;
                       /* Fehlerbehandlung */&lt;br /&gt;
                       case DTA_ErrorLevel:&lt;br /&gt;
                            if(tidata)&lt;br /&gt;
                            {&lt;br /&gt;
                              const ULONG errnum = IUtility-&amp;gt;GetTagData(DTA_ErrorNumber,0,tags);&lt;br /&gt;
                              PrintErrorMsg(errnum,(STRPTR) options[OPT_NAME]);&lt;br /&gt;
                            }&lt;br /&gt;
                            break;&lt;br /&gt;
&lt;br /&gt;
                       /* Refresh des Datatype-Objekts ausfÂ¸hren */&lt;br /&gt;
                       case DTA_Sync:&lt;br /&gt;
                            IDataTypes-&amp;gt;RefreshDTObjects(dto,win,NULL,NULL);&lt;br /&gt;
                            break;&lt;br /&gt;
                     }&lt;br /&gt;
              }&lt;br /&gt;
              break;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            /* verarbeitete Nachrichten zurÂ¸ckschicken */&lt;br /&gt;
            IExec-&amp;gt;ReplyMsg((struct Message *)imsg);&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        /* Objekt wieder aus dem Fenster entfernen */&lt;br /&gt;
        IDataTypes-&amp;gt;RemoveDTObject(win,dto);&lt;br /&gt;
&lt;br /&gt;
        /* Fenster schlieï¬en */&lt;br /&gt;
        IIntuition-&amp;gt;CloseWindow(win);&lt;br /&gt;
      }&lt;br /&gt;
      else IDOS-&amp;gt;Printf(&amp;quot;could not open window\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
      /* Datatype Objekt freigeben */&lt;br /&gt;
      IDataTypes-&amp;gt;DisposeDTObject(dto);&lt;br /&gt;
    }&lt;br /&gt;
    else PrintErrorMsg(IDOS-&amp;gt;IoErr(),(STRPTR)options[OPT_NAME]);&lt;br /&gt;
&lt;br /&gt;
    IDOS-&amp;gt;FreeArgs(rdargs);&lt;br /&gt;
  } else PrintErrorMsg(IDOS-&amp;gt;IoErr(),NULL);&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:AF109_showpic_screenshot.png|frame|center]]&lt;br /&gt;
[[File:AF109_showpic_result.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
== PlaySample Example  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* PlaySample.c&lt;br /&gt;
 *&lt;br /&gt;
 * gcc PlaySample.c -o PlaySample -l auto&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#define __USE_BASETYPE__&lt;br /&gt;
&lt;br /&gt;
/******************************* INCLUDES *************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;exec/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/soundclass.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;proto/exec.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/datatypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/intuition.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
extern struct Library        *DataTypesBase;&lt;br /&gt;
extern struct DataTypesIFace *IDataTypes;&lt;br /&gt;
extern struct IntuitionBase  *IntuitionBase;&lt;br /&gt;
extern struct IntuitionIFace *IIntuition;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  if(argc &amp;gt;= 2)&lt;br /&gt;
  {&lt;br /&gt;
    Object	*dt;&lt;br /&gt;
&lt;br /&gt;
    /* den Sample via Datatype laden */&lt;br /&gt;
    if((dt = IDataTypes-&amp;gt;NewDTObject(argv[1],&lt;br /&gt;
              DTA_GroupID,        GID_SOUND,&lt;br /&gt;
              SDTA_SignalTask,    IExec-&amp;gt;FindTask(NULL),&lt;br /&gt;
              SDTA_SignalBitMask, SIGBREAKF_CTRL_C,&lt;br /&gt;
              TAG_END)))&lt;br /&gt;
    {&lt;br /&gt;
      uint32 freq, per, len;&lt;br /&gt;
&lt;br /&gt;
      /* verschiedene Daten des Samples erfragen */&lt;br /&gt;
      IDataTypes-&amp;gt;GetDTAttrs(dt,&lt;br /&gt;
              SDTA_SamplesPerSec, &amp;amp;freq,&lt;br /&gt;
              SDTA_Period,        &amp;amp;per,&lt;br /&gt;
              SDTA_SampleLength,  &amp;amp;len,&lt;br /&gt;
              TAG_END);&lt;br /&gt;
&lt;br /&gt;
      IDOS-&amp;gt;Printf(&amp;quot;Freq: %ld, Period: %ld, Len: %ld\n&amp;quot;, freq, per, len);&lt;br /&gt;
&lt;br /&gt;
      /* einmal abspielen */&lt;br /&gt;
      IIntuition-&amp;gt;IDoMethod(dt,DTM_TRIGGER,NULL,STM_PLAY,NULL);&lt;br /&gt;
&lt;br /&gt;
      /* Signal wenn Sample fertig abgespielt oder Benutzerabbruch */&lt;br /&gt;
      IExec-&amp;gt;Wait(SIGBREAKF_CTRL_C);&lt;br /&gt;
&lt;br /&gt;
      /* Datatype freigeben */&lt;br /&gt;
      IDataTypes-&amp;gt;DisposeDTObject(dt);&lt;br /&gt;
    }&lt;br /&gt;
    else IDOS-&amp;gt;PrintFault(IDOS-&amp;gt;IoErr(),argv[1]);&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
  }&lt;br /&gt;
  else return 20;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:AF109_playsample_screenshot.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
= Scaling Image files =&lt;br /&gt;
&lt;br /&gt;
Apropos, there is also an option to scale the requested image file straight away, in order to fit it into a window for example. So, in contrast to IGraphics-&amp;gt;ScaleBitMap() you can also directly give it the desired height and width. The only disadvantage is that you can only scale the bitmap once before layout (meaning before the method DTM_PROCLAYOUT). The quality of scaling is determined with the tag PDTA_ScaleQuality where 0 if for fast/low quality and 1 for high/slow quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  Object *obj;&lt;br /&gt;
  if((obj = IDataTypes-&amp;gt;NewDTObject(filename,&lt;br /&gt;
                DTA_SourceType,    DTST_FILE,&lt;br /&gt;
                DTA_GroupID,       GID_PICTURE,&lt;br /&gt;
                PDTA_ScaleQuality, 1,&lt;br /&gt;
                TAG_END)))&lt;br /&gt;
  ...&lt;br /&gt;
  struct pdtScale pdt;&lt;br /&gt;
  pdt.MethodID     = PDTM_SCALE;&lt;br /&gt;
  pdt.ps_NewWidth  = width;&lt;br /&gt;
  pdt.ps_NewHeight = height;&lt;br /&gt;
  pdt.ps_Flags     = 0;&lt;br /&gt;
  if(!(IDataTypes-&amp;gt;DoDTMethodA(obj, (Msg)&amp;amp;pdt)))&lt;br /&gt;
    IDOS-&amp;gt;Printf(&amp;quot;Datatype Skalierung fehlgeschlagen&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The accompanying example program &amp;quot;ScalePic.c&amp;quot; displays the image when it is started in its original size. However, when you change the window size the image will be scaled up or down to fit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* ScalePic.c&lt;br /&gt;
 *&lt;br /&gt;
 * gcc ScalePic.c -o ScalePic -lauto&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/******************************* INCLUDES *************************************/&lt;br /&gt;
&lt;br /&gt;
#define __USE_INLINE__&lt;br /&gt;
#define __USE_BASETYPE__&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;exec/types.h&amp;gt;&lt;br /&gt;
#include &amp;lt;exec/memory.h&amp;gt;&lt;br /&gt;
#include &amp;lt;dos/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/datatypes.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/datatypesclass.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/pictureclass.h&amp;gt;&lt;br /&gt;
#include &amp;lt;graphics/gfx.h&amp;gt;&lt;br /&gt;
#include &amp;lt;graphics/scale.h&amp;gt;&lt;br /&gt;
#include &amp;lt;graphics/displayinfo.h&amp;gt;&lt;br /&gt;
#include &amp;lt;intuition/intuition.h&amp;gt;&lt;br /&gt;
#include &amp;lt;intuition/intuitionbase.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;proto/exec.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/intuition.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/graphics.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/datatypes.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/************************ VARIABLEN DEKLARATIONEN *****************************/&lt;br /&gt;
&lt;br /&gt;
struct IntuitionBase *IntuitionBase;&lt;br /&gt;
struct GfxBase       *GfxBase;&lt;br /&gt;
struct Library       *DataTypesBase;&lt;br /&gt;
&lt;br /&gt;
Object               *dt_Obj;&lt;br /&gt;
struct BitMap        *dt_Bitmap;&lt;br /&gt;
struct Screen        *dt_Scr;&lt;br /&gt;
struct Window        *dt_Win;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
BOOL ErmittleGfxSize(const UBYTE *filename, UWORD *width, UWORD *height)&lt;br /&gt;
{&lt;br /&gt;
  struct BitMapHeader *bmhd;&lt;br /&gt;
  Object              *obj;&lt;br /&gt;
&lt;br /&gt;
  if((obj = NewDTObject((APTR)filename,&lt;br /&gt;
                           DTA_SourceType, DTST_FILE,&lt;br /&gt;
                           DTA_GroupID,    GID_PICTURE,&lt;br /&gt;
                           TAG_END)))&lt;br /&gt;
  {&lt;br /&gt;
    if(GetDTAttrs(obj,&lt;br /&gt;
                  PDTA_BitMapHeader, &amp;amp;bmhd,&lt;br /&gt;
                  TAG_END))&lt;br /&gt;
    {&lt;br /&gt;
      *width  = bmhd-&amp;gt;bmh_Width;&lt;br /&gt;
      *height = bmhd-&amp;gt;bmh_Height;&lt;br /&gt;
    }&lt;br /&gt;
    else Printf(&amp;quot;Kann Datei nicht laden !\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    DisposeDTObject(obj);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  return width &amp;amp;&amp;amp; height ? TRUE : FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
LONG Load(const UBYTE *filename, ULONG scalequality, UWORD width, UWORD height)&lt;br /&gt;
{&lt;br /&gt;
  struct FrameInfo  fri = {0};&lt;br /&gt;
  struct dtFrameBox dtf = {0};&lt;br /&gt;
  struct gpLayout   gpl;&lt;br /&gt;
  struct pdtScale   pdt;&lt;br /&gt;
&lt;br /&gt;
  SetWindowPointer(dt_Win,WA_BusyPointer,TRUE,TAG_END);&lt;br /&gt;
&lt;br /&gt;
  /* Bilddatei mittels Datatype laden */&lt;br /&gt;
  if((dt_Obj = NewDTObject((APTR) filename,&lt;br /&gt;
         DTA_SourceType,        DTST_FILE,&lt;br /&gt;
         DTA_GroupID,           GID_PICTURE,  /* Datei muï¬ eine Bilddatei sein */&lt;br /&gt;
         PDTA_DestMode,         PMODE_V43,    /* fÂ¸r 24 Bit Verarbeitung */&lt;br /&gt;
         PDTA_Remap,            TRUE,         /* Farben an Bildschirm anpassen */&lt;br /&gt;
         PDTA_Screen,           dt_Scr,       /* diesen Bildschirm dazu verwenden */&lt;br /&gt;
         PDTA_FreeSourceBitMap, TRUE,         /* Source-Bitmap nach Bearbeitung sofort freigeben */&lt;br /&gt;
         PDTA_ScaleQuality,     scalequality, /* 0=schnell, 1=langsam aber gute Qualitâ°t */&lt;br /&gt;
         TAG_END)))&lt;br /&gt;
  {&lt;br /&gt;
    /* Umgebung ermitteln */&lt;br /&gt;
    dtf.MethodID          = DTM_FRAMEBOX;&lt;br /&gt;
    dtf.dtf_FrameInfo     = &amp;amp;fri;&lt;br /&gt;
    dtf.dtf_ContentsInfo  = &amp;amp;fri;&lt;br /&gt;
    dtf.dtf_SizeFrameInfo = sizeof(struct FrameInfo);&lt;br /&gt;
    if(IDoMethodA(dt_Obj,(Msg)&amp;amp;dtf) &amp;amp;&amp;amp; fri.fri_Dimensions.Depth)&lt;br /&gt;
    {&lt;br /&gt;
      /* Bild auf diese GrËï¬e skalieren */&lt;br /&gt;
      pdt.MethodID     = PDTM_SCALE;&lt;br /&gt;
      pdt.ps_NewWidth  = width;&lt;br /&gt;
      pdt.ps_NewHeight = height;&lt;br /&gt;
      pdt.ps_Flags     = 0;&lt;br /&gt;
      if(!(IDoMethodA(dt_Obj,(Msg)&amp;amp;pdt)))&lt;br /&gt;
        Printf(&amp;quot;Datatype Skalierung fehlgeschlagen\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
      /* das Bild noch layouten */&lt;br /&gt;
      gpl.MethodID    = DTM_PROCLAYOUT;&lt;br /&gt;
      gpl.gpl_GInfo   = NULL;&lt;br /&gt;
      gpl.gpl_Initial = 1;&lt;br /&gt;
      if(IDoMethodA(dt_Obj,(Msg)&amp;amp;gpl))&lt;br /&gt;
      {&lt;br /&gt;
        /* angepasste Bitmap erfragen */&lt;br /&gt;
        GetDTAttrs(dt_Obj,&lt;br /&gt;
                   PDTA_DestBitMap, &amp;amp;dt_Bitmap,&lt;br /&gt;
                   TAG_END);&lt;br /&gt;
&lt;br /&gt;
        if(dt_Bitmap)&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
        else Printf(&amp;quot;Keine Bitmap ?\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      else Printf(&amp;quot;Kann Bild nicht layouten\n&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    else Printf(&amp;quot;Kann Umgebungsdaten nicht ermitteln\n&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
  else Printf(&amp;quot;Kein passender Datentyp ?\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  SetWindowPointer(dt_Win,WA_Pointer,NULL,TAG_END);&lt;br /&gt;
&lt;br /&gt;
  return dt_Bitmap ? TRUE : FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void Unload()&lt;br /&gt;
{&lt;br /&gt;
  if(dt_Obj) DisposeDTObject(dt_Obj); dt_Obj = NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void Display(UWORD width, UWORD height)&lt;br /&gt;
{&lt;br /&gt;
  BltBitMapRastPort(dt_Bitmap,0,0,&lt;br /&gt;
                    dt_Win-&amp;gt;RPort,dt_Win-&amp;gt;BorderLeft,dt_Win-&amp;gt;BorderTop,&lt;br /&gt;
                    width,height, MINTERM_ABC | MINTERM_ABNC);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  ULONG options[2] = {0};&lt;br /&gt;
  struct RDArgs *rdargs;&lt;br /&gt;
&lt;br /&gt;
  if((rdargs = ReadArgs(&amp;quot;NAME/A,SQ=SCALEQUALITY/N&amp;quot;,(LONG *)options,NULL)))&lt;br /&gt;
  {&lt;br /&gt;
    const UBYTE *filename = (UBYTE*) options[0];&lt;br /&gt;
    /* wird keine Skalierungsqualitâ°t angegeben ,dann die gute verwenden */&lt;br /&gt;
    const ULONG scalequality = (options[1] ? *((ULONG*)options[1]) : 1);&lt;br /&gt;
&lt;br /&gt;
    IntuitionBase = (struct IntuitionBase *) OpenLibrary(&amp;quot;intuition.library&amp;quot;, 50);&lt;br /&gt;
    GfxBase       = (struct GfxBase *) OpenLibrary(&amp;quot;graphics.library&amp;quot;, 50);&lt;br /&gt;
    DataTypesBase = OpenLibrary(&amp;quot;datatypes.library&amp;quot;, 50);&lt;br /&gt;
    &lt;br /&gt;
    if(IntuitionBase &amp;amp;&amp;amp; GfxBase &amp;amp;&amp;amp; DataTypesBase)&lt;br /&gt;
    {&lt;br /&gt;
      dt_Scr = IntuitionBase-&amp;gt;ActiveScreen;&lt;br /&gt;
  &lt;br /&gt;
      UWORD width=0, height=0;&lt;br /&gt;
      if(ErmittleGfxSize(filename,&amp;amp;width,&amp;amp;height))&lt;br /&gt;
      {&lt;br /&gt;
        if((dt_Win = OpenWindowTags(NULL,&lt;br /&gt;
                                    WA_Left,            20,&lt;br /&gt;
                                    WA_Top,             20,&lt;br /&gt;
                                    WA_InnerWidth,      width, /* Standard-GrËï¬e */&lt;br /&gt;
                                    WA_InnerHeight,     height,&lt;br /&gt;
                                    WA_MinWidth,        60,  /* MinimalgrËï¬e */&lt;br /&gt;
                                    WA_MinHeight,       10,&lt;br /&gt;
                                    WA_MaxWidth,        dt_Scr-&amp;gt;Width * 2,  /* MaximalgrËï¬e */&lt;br /&gt;
                                    WA_MaxHeight,       dt_Scr-&amp;gt;Height * 2,&lt;br /&gt;
                                    WA_DragBar,         TRUE,&lt;br /&gt;
                                    WA_Activate,        TRUE,&lt;br /&gt;
                                    WA_CloseGadget,     TRUE,&lt;br /&gt;
                                    WA_SizeGadget,      TRUE,&lt;br /&gt;
                                    WA_SmartRefresh,    TRUE,&lt;br /&gt;
                                    WA_NoCareRefresh,   TRUE,&lt;br /&gt;
                                    WA_RMBTrap,         TRUE,&lt;br /&gt;
                                    WA_SizeBBottom,     TRUE,&lt;br /&gt;
                                    WA_IDCMP,           IDCMP_CLOSEWINDOW | IDCMP_NEWSIZE | IDCMP_RAWKEY | IDCMP_MOUSEBUTTONS,&lt;br /&gt;
                                    WA_Title,           &amp;quot;Skalierbarer Bildanzeiger&amp;quot;,&lt;br /&gt;
                                    TAG_END)))&lt;br /&gt;
        {&lt;br /&gt;
          BOOL laufen = TRUE;&lt;br /&gt;
          while(laufen)&lt;br /&gt;
          {&lt;br /&gt;
            Load(filename,scalequality,width,height);  /* Bilddatei laden */&lt;br /&gt;
            Display(width,height);                     /* und anzeigen */&lt;br /&gt;
&lt;br /&gt;
            /*&lt;br /&gt;
            ** normaler Nachrichtenloop, bis das Fenster geschlossen wird,&lt;br /&gt;
            ** oder CTRL-C an das Programm gesendet wird.&lt;br /&gt;
            */&lt;br /&gt;
            BOOL msglaufen = TRUE;&lt;br /&gt;
            while(msglaufen)&lt;br /&gt;
            {&lt;br /&gt;
              struct IntuiMessage *msg;&lt;br /&gt;
              const ULONG sigs = Wait(1L &amp;lt;&amp;lt; dt_Win-&amp;gt;UserPort-&amp;gt;mp_SigBit | SIGBREAKF_CTRL_C);&lt;br /&gt;
&lt;br /&gt;
              while((msg = (struct IntuiMessage *) GetMsg(dt_Win-&amp;gt;UserPort)))&lt;br /&gt;
              {&lt;br /&gt;
                if(msg-&amp;gt;Class == IDCMP_CLOSEWINDOW)&lt;br /&gt;
                {&lt;br /&gt;
                  msglaufen = laufen = FALSE;&lt;br /&gt;
                }&lt;br /&gt;
                else if(msg-&amp;gt;Class == IDCMP_NEWSIZE)&lt;br /&gt;
                {&lt;br /&gt;
                  msglaufen = FALSE;&lt;br /&gt;
                  width = dt_Win-&amp;gt;Width - dt_Win-&amp;gt;BorderLeft - dt_Win-&amp;gt;BorderRight;&lt;br /&gt;
                  height = dt_Win-&amp;gt;Height - dt_Win-&amp;gt;BorderTop - dt_Win-&amp;gt;BorderBottom;&lt;br /&gt;
                }&lt;br /&gt;
                else if(msg-&amp;gt;Class == IDCMP_RAWKEY)&lt;br /&gt;
                {&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                ReplyMsg((struct Message *)msg);&lt;br /&gt;
              }&lt;br /&gt;
&lt;br /&gt;
              if(sigs &amp;amp; SIGBREAKF_CTRL_C)&lt;br /&gt;
              {&lt;br /&gt;
                msglaufen = laufen = FALSE;&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
          CloseWindow(dt_Win);&lt;br /&gt;
        }&lt;br /&gt;
        else Printf(&amp;quot;Ã·ffnen des Fensters fehlgeschlagen.\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
      else Printf(&amp;quot;Bild &#039;%s&#039; kann nicht geladen werden\n&amp;quot;,filename);&lt;br /&gt;
      &lt;br /&gt;
      Unload();&lt;br /&gt;
    }&lt;br /&gt;
    else Printf(&amp;quot;Libraries fehlen.\n&amp;quot;);  &lt;br /&gt;
&lt;br /&gt;
    CloseLibrary(DataTypesBase);&lt;br /&gt;
    CloseLibrary((struct Library *)GfxBase);&lt;br /&gt;
    CloseLibrary((struct Library *)IntuitionBase);&lt;br /&gt;
&lt;br /&gt;
    FreeArgs(rdargs);&lt;br /&gt;
  }&lt;br /&gt;
  else PrintFault(IoErr(),&amp;quot;ScalePic&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Scaling quality comparison in 4x enlargement for comparison: On the left level 1 with soft edges. On the right with level one the jagged edges become especially obvious on diagonal edges.&lt;br /&gt;
&lt;br /&gt;
[[File:AF109_skalierungsqualitaet.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
= AHI for sound =&lt;br /&gt;
&lt;br /&gt;
The sound.datatype takes care of playing back the sample using AHI (Audio Hardware Interface) and not use the old Paula chip for that anymore. Although there is nothing against playing the sample directly from Datatype, it gives you more flexibility when you use the ahi.device directly for this. Also, because it is not all that complicated, we would like to give you an additional short example. As usual a MsgPort and for the conversion an IORequest (AHIRequest here) are required in order to open the ahi.device. The AHIRequest can theoretically be copied multiple times as well when multiple samples should be played (simultaneously). After charging AHIRequest with the sample file the asynchronous playback is done with an IExec-SendIO(), (IExec-&amp;gt;DoIO() would result in synchronous playback). The function returns immediately while the request is played back in the background. When this is completed (corresponding to completed playback) we receive the matching message on the message port. At the end of the program the device has to be closed and the MsgPort and Request have to be released. The program frame therefore should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  struct Library    *AHIBase;&lt;br /&gt;
  struct MsgPort    *AHImp;&lt;br /&gt;
  struct AHIRequest *AHIio;&lt;br /&gt;
&lt;br /&gt;
  if((AHImp = IExec-&amp;gt;CreateMsgPort()))&lt;br /&gt;
  {&lt;br /&gt;
    if((AHIio = (struct AHIRequest *) IExec-&amp;gt;CreateIORequest(AHImp,sizeof(struct AHIRequest))))&lt;br /&gt;
    {&lt;br /&gt;
      AHIio-&amp;gt;ahir_Version = 4;&lt;br /&gt;
      if(!(IExec-&amp;gt;OpenDevice(AHINAME, 0,(struct IORequest *) AHIio,NULL)))&lt;br /&gt;
      {&lt;br /&gt;
        AHIBase = (struct Library *) AHIio-&amp;gt;ahir_Std.io_Device;&lt;br /&gt;
        ...&lt;br /&gt;
        IExec-&amp;gt;CloseDevice((struct IORequest *)AHIio);&lt;br /&gt;
      }&lt;br /&gt;
      IExec-&amp;gt;DeleteIORequest((struct IORequest *)AHIio);&lt;br /&gt;
    }&lt;br /&gt;
    IExec-&amp;gt;DeleteMsgPort(AHImp);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Connecting sound.datatype and ahi.device =&lt;br /&gt;
&lt;br /&gt;
The whole thing becomes truly elegant when the sound files are loaded using datatypes and the ahi.device is used for coordinated playback. In principle the rule is again to use the already discussed method: open ahi.device and datatypes.library and use IDataTypes-&amp;gt;NewDataType() to identify the files. With the help of that we now fill the AHIRequest. For that we need to ascertain a few values from Datatype. Especially the address of the file and the playback frequency.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
    BYTE *gb_Data; LONG gb_Length, gb_Freq;&lt;br /&gt;
    IDataTypes-&amp;gt;GetDTAttrs(gb_Obj,&lt;br /&gt;
                 SDTA_Sample,        &amp;amp;gb_Data,&lt;br /&gt;
                 SDTA_SampleLength,  &amp;amp;gb_Length,&lt;br /&gt;
                 SDTA_SamplesPerSec, &amp;amp;gb_Freq,&lt;br /&gt;
                 TAG_END);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The thing is reproduced with IExec-&amp;gt;SendIO() and  with IExec-&amp;gt;Wait() it waits until playback is completed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Command  = CMD_WRITE;&lt;br /&gt;
  ...&lt;br /&gt;
  IExec-&amp;gt;SendIO((struct IORequest *) AHIio);&lt;br /&gt;
  IExec-&amp;gt;Wait(1L &amp;lt;&amp;lt; AHImp-&amp;gt;mp_SigBit);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is all shown together once more in the example program &amp;quot;PlayAHI.c&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* PlayAHI.c&lt;br /&gt;
 *&lt;br /&gt;
 * gcc PlayAHI.c -o PlayAHI -l auto&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/******************************* INCLUDES *************************************/&lt;br /&gt;
&lt;br /&gt;
#define __USE_BASETYPE__&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;devices/ahi.h&amp;gt;&lt;br /&gt;
#include &amp;lt;dos/dosasl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;exec/memory.h&amp;gt;&lt;br /&gt;
#include &amp;lt;intuition/classusr.h&amp;gt;&lt;br /&gt;
#include &amp;lt;datatypes/soundclass.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;proto/exec.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/dos.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/ahi.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/intuition.h&amp;gt;&lt;br /&gt;
#include &amp;lt;proto/datatypes.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/************************ VARIABLEN DEKLARATIONEN *****************************/&lt;br /&gt;
&lt;br /&gt;
struct Library        *AHIBase;&lt;br /&gt;
struct Library        *DataTypesBase;&lt;br /&gt;
struct DataTypesIFace *IDataTypes;&lt;br /&gt;
struct MsgPort        *AHImp;&lt;br /&gt;
struct AHIRequest     *AHIio;&lt;br /&gt;
&lt;br /&gt;
BYTE   *gb_Data;&lt;br /&gt;
LONG    gb_Freq;&lt;br /&gt;
LONG    gb_Length;&lt;br /&gt;
Object *gb_Obj;&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
BOOL OpenAHI(void)&lt;br /&gt;
{&lt;br /&gt;
  if((AHImp = IExec-&amp;gt;AllocSysObjectTags( ASOT_PORT, TAG_END )))&lt;br /&gt;
  {&lt;br /&gt;
&lt;br /&gt;
    if((AHIio = (struct AHIRequest *) IExec-&amp;gt;AllocSysObjectTags( ASOT_IOREQUEST,&lt;br /&gt;
                                          ASOIOR_Size,      sizeof( struct AHIRequest ),&lt;br /&gt;
                                          ASOIOR_ReplyPort, AHImp,&lt;br /&gt;
                                          TAG_END )))&lt;br /&gt;
    {&lt;br /&gt;
      AHIio-&amp;gt;ahir_Version = 6;&lt;br /&gt;
      if(!(IExec-&amp;gt;OpenDevice(AHINAME, 0,(struct IORequest *) AHIio, 0)))&lt;br /&gt;
      {&lt;br /&gt;
        AHIBase = (struct Library *) AHIio-&amp;gt;ahir_Std.io_Device;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return AHIBase ? TRUE : FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void CloseAHI(void)&lt;br /&gt;
{&lt;br /&gt;
  if(AHIBase) IExec-&amp;gt;CloseDevice((struct IORequest *)AHIio); AHIBase = NULL;&lt;br /&gt;
  if(AHIio) IExec-&amp;gt;FreeSysObject(ASOT_IOREQUEST,AHIio); AHIio = NULL;&lt;br /&gt;
  if(AHImp) IExec-&amp;gt;FreeSysObject(ASOT_PORT,AHImp); AHImp = NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
BOOL LoadSample(STRPTR filename)&lt;br /&gt;
{&lt;br /&gt;
  if((gb_Obj = IDataTypes-&amp;gt;NewDTObject((APTR)filename,&lt;br /&gt;
                       DTA_SourceType,  DTST_FILE,&lt;br /&gt;
                       DTA_GroupID,     GID_SOUND,&lt;br /&gt;
                       TAG_END)))&lt;br /&gt;
  {&lt;br /&gt;
    IDataTypes-&amp;gt;GetDTAttrs(gb_Obj,&lt;br /&gt;
               SDTA_Sample,        &amp;amp;gb_Data,&lt;br /&gt;
               SDTA_SampleLength,  &amp;amp;gb_Length,&lt;br /&gt;
               SDTA_SamplesPerSec, &amp;amp;gb_Freq,&lt;br /&gt;
               TAG_END);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  if(gb_Data != 0 &amp;amp;&amp;amp; gb_Length &amp;gt; 0 &amp;amp;&amp;amp; gb_Freq != 0 &amp;amp;&amp;amp; gb_Obj != NULL)&lt;br /&gt;
    return TRUE;&lt;br /&gt;
  else&lt;br /&gt;
    return FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void UnloadSample(void)&lt;br /&gt;
{&lt;br /&gt;
  if(gb_Obj) IDataTypes-&amp;gt;DisposeDTObject(gb_Obj); gb_Obj = NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void Play(void)&lt;br /&gt;
{&lt;br /&gt;
  IDOS-&amp;gt;Printf(&amp;quot;playing %ld bytes at %ld hz\n&amp;quot;, gb_Length, gb_Freq);&lt;br /&gt;
&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Message.mn_Node.ln_Pri = 5;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Command  = CMD_WRITE;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Data     = gb_Data;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Length   = gb_Length;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Std.io_Offset   = 0;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Frequency       = gb_Freq;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Type            = AHIST_M8S;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Volume          = 0x10000;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Position        = 0x8000;&lt;br /&gt;
  AHIio-&amp;gt;ahir_Link            = NULL;&lt;br /&gt;
&lt;br /&gt;
  IExec-&amp;gt;SendIO((struct IORequest *) AHIio);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
void StopPlay(void)&lt;br /&gt;
{&lt;br /&gt;
  if(! IExec-&amp;gt;CheckIO((struct IORequest *) AHIio))&lt;br /&gt;
  {&lt;br /&gt;
    IExec-&amp;gt;AbortIO((struct IORequest *) AHIio);&lt;br /&gt;
    IExec-&amp;gt;WaitIO((struct IORequest *) AHIio);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/******************************************************************************/&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
  if((DataTypesBase = IExec-&amp;gt;OpenLibrary(&amp;quot;datatypes.library&amp;quot;, 50)))&lt;br /&gt;
  {&lt;br /&gt;
    if((IDataTypes = (struct DataTypesIFace *) IExec-&amp;gt;GetInterface(DataTypesBase,&amp;quot;main&amp;quot;,1,NULL)))&lt;br /&gt;
    {&lt;br /&gt;
      if(OpenAHI())&lt;br /&gt;
      {&lt;br /&gt;
        if(LoadSample(argv[1]))&lt;br /&gt;
        {&lt;br /&gt;
          Play();&lt;br /&gt;
&lt;br /&gt;
          const LONG signal = IExec-&amp;gt;Wait(SIGBREAKF_CTRL_C | (1L &amp;lt;&amp;lt; AHImp-&amp;gt;mp_SigBit));&lt;br /&gt;
          if(signal &amp;amp; SIGBREAKF_CTRL_C) IDOS-&amp;gt;Printf(&amp;quot;*** break\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
          StopPlay();&lt;br /&gt;
        }&lt;br /&gt;
        else IDOS-&amp;gt;Printf(&amp;quot;Error load sample\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        UnloadSample();&lt;br /&gt;
      }&lt;br /&gt;
      else IDOS-&amp;gt;Printf(&amp;quot;Error open ahi.device\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
      CloseAHI();&lt;br /&gt;
&lt;br /&gt;
      IExec-&amp;gt;DropInterface((struct Interface *)IDataTypes);&lt;br /&gt;
    }&lt;br /&gt;
    else IDOS-&amp;gt;Printf(&amp;quot;Error get datatypes interface\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    IExec-&amp;gt;CloseLibrary(DataTypesBase);&lt;br /&gt;
  }&lt;br /&gt;
  else IDOS-&amp;gt;Printf(&amp;quot;Error open datatypes.library V50\n&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:AF109_playahi.png|frame|center]]&lt;br /&gt;
&lt;br /&gt;
= Datatypes internally =&lt;br /&gt;
&lt;br /&gt;
Technically speaking the Datatypes are realised as Shared-Library and stored as single files in the directory &amp;quot;SYS:Classes/Datatypes&amp;quot; with the #?.datatype extension. Whether a datatype is active as well is stored with a second file in the directory &amp;quot;SYS:Devs/DataTypes&amp;quot;. These files are already automatically activated at the start of Workbench. Inactive descriptors on the other hand are found in &amp;quot;SYS:Storage/DataTypes&amp;quot; and can additionally be started as well when needed by double clicking the icon.&lt;br /&gt;
&lt;br /&gt;
= In perspective =&lt;br /&gt;
&lt;br /&gt;
In our previous edition we already pointed out the new functions of intuition.library, with which it is even easier to load and use image files from harddisk, without having to do the single steps of datatypes.library. We are talking about IIntuition-&amp;gt;ObtainBitMapSource(), IIntuition-&amp;gt;ObtainBitMapInstance() and IIntuition-&amp;gt;BitMapInstanceControl(). We would like to give you a quick reminder of them in view of this topic.&lt;br /&gt;
&lt;br /&gt;
The other formats, like animation or text, are handled in a similar way. The most important are surely graphics and sounds, which we presented in detail.&lt;br /&gt;
&lt;br /&gt;
= Important tags =&lt;br /&gt;
&lt;br /&gt;
Here is an overview of the most important Datatype-Tags, to be able to query the files with IDataTypes-&amp;gt;GetDTAttrs().&lt;br /&gt;
&lt;br /&gt;
picture.datatype:&lt;br /&gt;
 PDTA_BitMap          struct BitMap *  BitMap with the graphic data&lt;br /&gt;
 PDTA_DestBitMap      struct BitMap *  graphics data adapted to screen colours&lt;br /&gt;
 PDTA_ColorTable      ULONG *          Colour table&lt;br /&gt;
 PDTA_NumColors       UWORD            Number of colours used in the image&lt;br /&gt;
 PDTA_BitMapHeader    struct BitMapHeader * Graphic-Information (Size etc.)&lt;br /&gt;
&lt;br /&gt;
sound.datatype:&lt;br /&gt;
 SDTA_SamplesPerSec   UWORD            Playback speed&lt;br /&gt;
 SDTA_Period          UWORD            Playback speed (alternative)&lt;br /&gt;
 SDTA_Sample          UWORD *          Sound-File to play &lt;br /&gt;
 SDTA_SampleLength    ULONG            Lenght of the sound file&lt;br /&gt;
 SDTA_VoiceHeader     struct VoiceHeader * Sample-Information&lt;br /&gt;
&lt;br /&gt;
text.datatype:&lt;br /&gt;
 TDTA_Buffer          STRPTR           Text-File&lt;br /&gt;
 TDTA_BufferLen       ULONG            Length of the text files&lt;br /&gt;
&lt;br /&gt;
animation.datatype:&lt;br /&gt;
 ADTA_Width           ULONG            Width in Pixels&lt;br /&gt;
 ADTA_Height          ULONG            Height in Pixels&lt;br /&gt;
 ADTA_Depth           ULONG            Colour depth&lt;br /&gt;
 ADTA_Frames          ULONG            Number of frames in the Animation&lt;br /&gt;
 ADTA_FramesPerSecond ULONG      Playback speed&lt;br /&gt;
 ADTA_Sample          UWORD *         Sound-file of the Animation&lt;br /&gt;
&lt;br /&gt;
= Authors =&lt;br /&gt;
&lt;br /&gt;
Written by Michael Christoph&amp;lt;br/&amp;gt;&lt;br /&gt;
Translation by Richard Mulder.&amp;lt;br/&amp;gt;&lt;br /&gt;
Copyright (c) 2013 Michael Christoph&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6906</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6906"/>
		<updated>2014-01-28T05:08:58Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* WINDOW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR&#039; command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Moves the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Moves the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Moves the view left by about 1/8 of the window width. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Moves the view right by about 1/8 of the window width. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window&#039;s current view position, use the GETATTR command and query the window&#039;s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6905</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6905"/>
		<updated>2014-01-28T05:04:03Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* HELP command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR&#039; command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Moves the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Moves the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Moves the view left by about 1/8 of the window width. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Moves the view right by about 1/8 of the window width. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window&#039;s current view position, use the GETATTR command and query the window&#039;s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6904</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6904"/>
		<updated>2014-01-28T05:01:07Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* VIEW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Moves the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Moves the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Moves the view left by about 1/8 of the window width. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Moves the view right by about 1/8 of the window width. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window&#039;s current view position, use the GETATTR command and query the window&#039;s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6903</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6903"/>
		<updated>2014-01-28T04:57:11Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* UNZOOMWINDOW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6902</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6902"/>
		<updated>2014-01-28T04:55:26Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* SIZEWINDOW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6901</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6901"/>
		<updated>2014-01-28T04:50:02Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* MENU command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the &amp;quot;Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the &amp;quot;Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows is currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6900</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6900"/>
		<updated>2014-01-28T04:38:41Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* LOCKGUI command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6899</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6899"/>
		<updated>2014-01-28T04:36:58Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* KEYBOARD command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * &amp;quot;test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6898</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6898"/>
		<updated>2014-01-28T04:30:16Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* GETATTR command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;6 26 12 6&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportionally spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039; &#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the &amp;quot;MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item * to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6897</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6897"/>
		<updated>2014-01-28T04:19:31Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* CHANGEWINDOW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30 and change its size to 200x100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;4 3 4 3&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039;&#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item * to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6896</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6896"/>
		<updated>2014-01-28T04:15:48Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: /* ACTIVATEWINDOW command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30. * and change its size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;4 3 4 3&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039;&#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item * to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6895</id>
		<title>AmigaOS Manual: Workbench ARexx Port</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_Workbench_ARexx_Port&amp;diff=6895"/>
		<updated>2014-01-28T03:03:29Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: First pass typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Workbench acts as an ARexx host under the name of &amp;quot;WORKBENCH&amp;quot;. It supports a number of commands as will be described below. Note that for the ARexx interface to work, rexxsyslib.library must be installed (this library is part of a regular Workbench installation) and the RexxMast program must have been started.&lt;br /&gt;
&lt;br /&gt;
= ACTIVATEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to make a window the active one.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ACTIVATEWINDOW [WINDOW] &amp;lt;ROOT|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ACTIVATEWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to activate the Workbench root window (where volume icons and AppIcons live) or the fully qualified name of a drawer window to activate. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be activated. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window activated that is not the root window you must make sure that the window name is given as a fully qualified path name. For example Work:&amp;quot; is a fully qualified name, and so is SYS:Utilities&amp;quot;. Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Activate the root window. */ ADDRESS workbench&lt;br /&gt;
ACTIVATEWINDOW root&lt;br /&gt;
&lt;br /&gt;
/* Activate the &amp;quot;Work:&amp;quot; partition&#039;s window. */&lt;br /&gt;
ACTIVATEWINDOW &#039;Work:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= CHANGEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size and the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: CHANGEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;][[TOPEDGE] &amp;lt;new top edge position&amp;gt;][[WIDTH] &amp;lt;new window width&amp;gt;][[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: CHANGEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameter:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize/move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be changed; this can also happen if you specified ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window; move it to position 10,30. * and change its size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
CHANGEWINDOW root LEFTEDGE 10 TOPEDGE 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Change the currently active window. */&lt;br /&gt;
CHANGEWINDOW active 20 40 200 100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DELETE command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for deleting files and drawers (and their contents).&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: DELETE [NAME] &amp;lt;File or drawer name&amp;gt; [ALL]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: DELETE NAME/A,ALL/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file or drawer or volume to delete.&lt;br /&gt;
&lt;br /&gt;
: ALL&lt;br /&gt;
:: If the object in question is a drawer, attempt to delete the contents of the drawer as well as the drawer itself. If this option is not specified, the DELETE command will only attempt to delete the drawer itself, which may fail if the drawer is not yet empty.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found or could not be deleted.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The file name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Delete the contents of the drawer RAM:Empty&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
DELETE &#039;RAM:Empty&#039; ALL &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAULT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will return a human readable explanation corresponding to an error code.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: FAULT [CODE] &amp;lt;Error code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: FAULT CODE/A/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CODE&lt;br /&gt;
:: Error code to return a human readable explanation for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the error message corresponding to error code #205. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
FAULT 205&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= GETATTR command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will retrieve information from the Workbench database, such the names of the drawers currently open and the icons currently selected.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: GETATTR [OBJECT] &amp;lt;Object name&amp;gt; [NAME &amp;lt;Item name&amp;gt;][STEM &amp;lt;Name of stem variable&amp;gt;] [VAR &amp;lt;Variable name&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: GETATTR OBJECT/A,NAME/K,STEM/K,VAR/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OBJECT&lt;br /&gt;
:: Name of the database entry to retrieve. For a list of valid entries see below.&lt;br /&gt;
&lt;br /&gt;
: NAME&lt;br /&gt;
:: For some datatabase entries further information is required to identify the data to retrieve. This is when you will need to provide a name.&lt;br /&gt;
&lt;br /&gt;
: STEM&lt;br /&gt;
:: If you request more than one database entry you will need to provide a variable to store the information in. For an example of its use, see below.&lt;br /&gt;
&lt;br /&gt;
: VAR&lt;br /&gt;
:: If you want the queried information to be stored in a specific variable (other than the RESULT variable), this is where you provide its name.&lt;br /&gt;
&lt;br /&gt;
; Attributes:&lt;br /&gt;
: You can obtain information on the following attributes:&lt;br /&gt;
: APPLICATION.VERSION&lt;br /&gt;
:: Version number of workbench.library&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:APPLICATION.SCREEN&lt;br /&gt;
:: Name of the public screen Workbench uses.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.AREXX&lt;br /&gt;
:: Name of the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.LASTERROR&lt;br /&gt;
:: Number of the last error caused by the ARexx interface.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.ICONBORDER&lt;br /&gt;
:: Sizes of the icon borders, returned as four numbers separated by blank spaces, e.g. &amp;quot;4 3 4 3&amp;quot;. The four numbers represent the left border width, the top border height, the right border width and the bottom border height (in exactly that order).&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.NAME&lt;br /&gt;
:: Name of the Workbench screen font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.WIDTH APPLICATION.FONT.SCREEN.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench screen font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SCREEN.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the screen font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.NAME&lt;br /&gt;
:: Name of the Workbench icon font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.WIDTH APPLICATION.FONT.ICON.HEIGHT&lt;br /&gt;
:: Size of a single character of the Workbench icon font. Please note that since the font in question may be proportional spaced the width information may be of little value. To measure the accurate pixel width of a text in reference to the font, use the .SIZE attribute.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.ICON.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the icon font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.NAME&lt;br /&gt;
:: Name of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.WIDTH&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.HEIGHT&lt;br /&gt;
:: Size of a single character of the system font.&lt;br /&gt;
&lt;br /&gt;
: APPLICATION.FONT.SYSTEM.SIZE&lt;br /&gt;
:: Size of a text, measured in pixels, in reference to the system font. The text to measure must be provided with the NAME parameter of the GETATTR command.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.COUNT&lt;br /&gt;
:: Number of the drawer windows currently open. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.0 .. WINDOWS.N&lt;br /&gt;
:: Names of the windows currently open.&lt;br /&gt;
&lt;br /&gt;
: WINDOWS.ACTIVE&lt;br /&gt;
:: Name of the currently active Workbench window; this will be &#039;&#039; if none of Workbench&#039;s windows is currently active.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.COUNT&lt;br /&gt;
:: Number of keyboard commands assigned. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.0 .. KEYCOMMANDS.N&lt;br /&gt;
:: Information on all the keyboard commands assigned.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.KEY&lt;br /&gt;
:: The key combination assigned to this keyboard command.&lt;br /&gt;
&lt;br /&gt;
: KEYCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this key combination.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.COUNT&lt;br /&gt;
:: Number of menu commands assigned (through the MENU ADD ..&amp;quot; command). This can be 0.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.0 .. MENUCOMMANDS.N&lt;br /&gt;
:: Information on all the menu commands assigned.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.TITLE&lt;br /&gt;
:: Title of this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.SHORTCUT&lt;br /&gt;
:: The keyboard shortcut assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: MENUCOMMANDS.&amp;lt;n&amp;gt;.COMMAND&lt;br /&gt;
:: The ARexx command assigned to this menu item.&lt;br /&gt;
&lt;br /&gt;
: The following attributes require the name of the window to obtain information.&lt;br /&gt;
: WINDOW.LEFT&lt;br /&gt;
:: Left edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.TOP&lt;br /&gt;
:: Top edge of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.WIDTH&lt;br /&gt;
:: Width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.HEIGHT&lt;br /&gt;
:: Height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.WIDTH&lt;br /&gt;
:: Minimum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MIN.HEIGHT&lt;br /&gt;
:: Minimum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.WIDTH&lt;br /&gt;
:: Maximum width of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.MAX.HEIGHT&lt;br /&gt;
:: Maximum height of the window.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.LEFT&lt;br /&gt;
:: Horizontal offset of the drawer contents; this value corresponds to the horizontal window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEW.TOP&lt;br /&gt;
:: Vertical offset of the drawer contents; this value corresponds to the vertical window scroller position.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.NAME&lt;br /&gt;
:: Name of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SCREEN.WIDTH WINDOW.SCREEN.HEIGHT&lt;br /&gt;
:: Size of the public screen the window was opened on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.COUNT&lt;br /&gt;
:: Number of the icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.0 .. WINDOW.ICONS.ALL.N&lt;br /&gt;
:: Information on all the icons displayed in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.ALL.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and &amp;quot;CLOSED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.COUNT&lt;br /&gt;
:: Number of the selected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.0 .. WINDOW.ICONS.SELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT,GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.SELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;SELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;UNSELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.SELECTED stem the icon status will always be reported as &amp;quot;SELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.COUNT&lt;br /&gt;
:: Number of the unselected icons displayed in the window. This can be 0.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.0 .. WINDOW.ICONS.UNSELECTED.N&lt;br /&gt;
:: Information on all selected the icons in the window:&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.NAME&lt;br /&gt;
:: Name of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.LEFT WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TOP&lt;br /&gt;
:: Position of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.WIDTH WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.HEIGHT&lt;br /&gt;
:: Size of the icon in question.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.TYPE&lt;br /&gt;
:: Type of the icon; one of DISK, DRAWER, TOOL, PROJECT, GARBAGE, DEVICE, KICK or APPICON.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.ICONS.UNSELECTED.&amp;lt;n&amp;gt;.STATUS&lt;br /&gt;
:: Whether the icon is selected and (if the icon is a drawer-like object, such as a disk, drawer or trashcan icon) whether the corresponding drawer is currently open or closed. This attribute is returned in the form of a string, such as &amp;quot;UNSELECTED OPEN&amp;quot; which means that the icon is selected and the corresponding drawer is currently open. The other options include &amp;quot;SELECTED&amp;quot; and CLOSED&amp;quot;. Of course, for the WINDOW.ICONS.UNSELECTED stem the icon status will always be reported as &amp;quot;UNSELECTED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the requester information could not be retrieved, you requested more than one database entry and did not provide a stem variable or if you provided a stem variable but did not request more than one database entry. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT - The information retrieved from the database.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Query the Workbench version. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the Workbench version and store it in the * variable &#039;version_number&#039;. */&lt;br /&gt;
GETATTR application.version&lt;br /&gt;
VAR version_number&lt;br /&gt;
SAY version_number&lt;br /&gt;
&lt;br /&gt;
/* Query the names of all currently open windows, * then print them. */&lt;br /&gt;
GETATTR windows&lt;br /&gt;
STEM window_list&lt;br /&gt;
&lt;br /&gt;
DO i = 0 TO window_list.count-1&lt;br /&gt;
SAY window_list.i;&lt;br /&gt;
END;&lt;br /&gt;
&lt;br /&gt;
/* Query name, position and size of the first icon * shown in the root window. */&lt;br /&gt;
GETATTR window.icons.all.0&lt;br /&gt;
NAME root&lt;br /&gt;
STEM root&lt;br /&gt;
&lt;br /&gt;
SAY root.name&lt;br /&gt;
SAY root.left&lt;br /&gt;
SAY root.top&lt;br /&gt;
SAY root.width&lt;br /&gt;
SAY root.height&lt;br /&gt;
SAY root.type&lt;br /&gt;
&lt;br /&gt;
/* Query the width and height of the root window. */&lt;br /&gt;
GETATTR window.width&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
GETATTR window.height&lt;br /&gt;
NAME root&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Query the length of a text (in pixels) with reference * to the icon font. */&lt;br /&gt;
GETATTR application.font.icon.size&lt;br /&gt;
NAME &#039;Text to measure&#039;&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HELP command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to open the online help and to obtain information on the supported menus, commands and command parameters.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: HELP [COMMAND &amp;lt;Command name&amp;gt;] [MENUS] [PROMPT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: HELP COMMAND/K,MENUS/S,PROMPT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: Name of the command whose command template should be retrieved.&lt;br /&gt;
&lt;br /&gt;
: MENUS&lt;br /&gt;
:: Specify this parameter to retrieve a list of menu items currently available.&lt;br /&gt;
&lt;br /&gt;
: PROMPT&lt;br /&gt;
:: Specify this parameter to invoke the online help system.&lt;br /&gt;
&lt;br /&gt;
:: If no parameter is provided, a list of supported commands will be returned.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named command is not supported by the ARexx interface. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: RESULT&lt;br /&gt;
: The command template, list of menu items or commands, as specified in the command parameters.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Retrieve the list of supported commands. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
OPTIONS results&lt;br /&gt;
&lt;br /&gt;
HELP&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the command template of the &#039;GETATTR` command. */&lt;br /&gt;
HELP COMMAND getattr&lt;br /&gt;
SAY result&lt;br /&gt;
&lt;br /&gt;
/* Retrieve the list of available menu items. */&lt;br /&gt;
HELP MENUS&lt;br /&gt;
SAY result &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ICON command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for manipulating the icons displayed in a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ICON [WINDOW] &amp;lt;Window name&amp;gt; &amp;lt;Icon name&amp;gt; .. &amp;lt;Icon name&amp;gt; [OPEN] [MAKEVISIBLE] [SELECT] [UNSELECT] [UP &amp;lt;Pixels&amp;gt;] [DOWN &amp;lt;Pixels&amp;gt;] [LEFT &amp;lt;Pixels&amp;gt;] [RIGHT &amp;lt;Pixels&amp;gt;] [X &amp;lt;Horizontal position&amp;gt;] [Y &amp;lt;Vertical position&amp;gt;] [ACTIVATE UP|DOWN|LEFT|RIGHT] [CYCLE PREVIOUS|NEXT] [MOVE IN|OUT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ICON WINDOW,NAMES/M,OPEN/S,MAKEVISIBLE/S,SELECT/S,UNSELECT/S, UP/N,DOWN/N,LEFT/N,RIGHT/N,X/N,Y/N,ACTIVATE/K,CYCLE/K, MOVE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose icons should be manipulated. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: NAMES&lt;br /&gt;
:: Names of the icons to manipulate.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Specifies that the named icons should be opened.&lt;br /&gt;
&lt;br /&gt;
: MAKEVISIBLE&lt;br /&gt;
:: Specifies that the named icons should be made visible. This generally works well for the first icon in a list but does not always work for a whole list.&lt;br /&gt;
&lt;br /&gt;
: SELECT&lt;br /&gt;
:: Select the named icons.&lt;br /&gt;
&lt;br /&gt;
: UNSELECT&lt;br /&gt;
:: Unselect the named icons.&lt;br /&gt;
&lt;br /&gt;
: UP, DOWN, LEFT, RIGHT&lt;br /&gt;
:: Move the named icons by the specified number of pixels.&lt;br /&gt;
&lt;br /&gt;
: X, Y&lt;br /&gt;
:: Move the named icons to the specified position.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: This command is for activating the icon closest to the currently selected icon in the window. &amp;quot;Activating&amp;quot; in this context means selecting an icon, whilst at the same time unselecting all others. Thus, the &amp;quot;active&amp;quot; icon is the only selected icon in the window.&lt;br /&gt;
&lt;br /&gt;
:: You can indicate which direction the next icon to be activated should be searched for, relative to the currently active icon. &amp;quot;UP&amp;quot; searches upwards, &amp;quot;DOWN&amp;quot; searches downwards, &amp;quot;LEFT&amp;quot; searches to the left and &amp;quot;RIGHT&amp;quot; searches to the right.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command is for cycling through all icons in a window, making each one the active one in turn (for a description of what &amp;quot;active&amp;quot; means in this context, see the &amp;quot;ACTIVATE&amp;quot; description above). You must indicate in which direction you want to cycle through the icons: you can either specify &amp;quot;PREVIOUS&amp;quot; or &amp;quot;NEXT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: MOVE&lt;br /&gt;
:: This command is not for moving icons but for moving through a file system hierarchy. Thus, moving &amp;quot;in&amp;quot; will open a drawer and moving &amp;quot;out&amp;quot; will open the drawer&#039;s parent directory. The &amp;quot;IN&amp;quot; parameter will cause the drawer represented by the active icon to be opened. Please note that an icon must be selected and it must be a drawer. The &amp;quot;OUT&amp;quot; parameter will open the drawer&#039;s parent directory, and it also requires that in the drawer there is an icon selected. This may sound strange, but this feature is not meant as a replacement for the &amp;quot;Open Parent&amp;quot; menu item.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Select the icons of the &amp;quot;Workbench&amp;quot; and &amp;quot;Work&amp;quot; volumes displayed in the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench Work SELECT&lt;br /&gt;
&lt;br /&gt;
/* Open the &amp;quot;Workbench&amp;quot; volume icon displayed in the root window. */&lt;br /&gt;
ICON WINDOW root&lt;br /&gt;
NAMES Workbench OPEN &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= INFO command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for opening the Workbench icon information requester.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: INFO [NAME] &amp;lt;File, drawer or volume name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: INFO NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters :&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the file, drawer or volume to open the information window for.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named file, drawer or volume could not be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the information window for SYS:&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
INFO NAME &#039;SYS:&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= KEYBOARD command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command can be used to bind ARexx commands to key combinations.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: KEYBOARD [NAME] &amp;lt;Name of key combination&amp;gt; ADD|REMOVE [KEY &amp;lt;Key combination&amp;gt;] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: KEYBOARD NAME/A,ADD/S,REMOVE/S,KEY,CMD/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the key combination to add or remove. Each key combination must have a name with which it is associated. The name must be unique.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the KEYBOARD command to add a new keyboard combination. You will also need to specify the KEY and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the KEYBOARD command to remove an existing keyboard combination.&lt;br /&gt;
&lt;br /&gt;
: KEY&lt;br /&gt;
:: The keyboard combination to add; this must be in the same format as used by the Commodities programs.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the keyboard combination. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - The command will fail if you tried to add a duplicate of an existing key combination or if the key combination to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bind an ARexx script to the [Control]+A key combination.&lt;br /&gt;
 * When pressed, this will cause the ARexx script by the name &lt;br /&gt;
 * test.wb&amp;quot; to be executed. ARexx will search for that program &lt;br /&gt;
 * in the REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can be found, ARexx will attempt to execute a script &lt;br /&gt;
 * by the name of test.rexx&amp;quot;. */&lt;br /&gt;
&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
KEYBOARD ADD NAME test1 KEY ,&amp;quot;ctrl a&amp;quot;, CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Alt]+[F1] key combination. &lt;br /&gt;
 * When pressed, this will cause a short inline program to be &lt;br /&gt;
 * executed. */&lt;br /&gt;
KEYBOARD ADD NAME test2 KEY ,&amp;quot;alt f1&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Bind an ARexx script to the [Shift]+[Help] key combination. &lt;br /&gt;
 * When pressed, this will cause the &amp;quot;Workbench About&amp;quot; menu item * to be invoked. */&lt;br /&gt;
KEYBOARD ADD NAME test3 KEY ,&amp;quot;shift help&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first key combination we added above. */&lt;br /&gt;
KEYBOARD REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= LOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will block access to all Workbench drawer windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: LOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Block access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
LOCKGUI &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MENU command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for invoking items of the Workbench menu, as if the user had selected them with the mouse and for adding/removing user menus.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MENU [WINDOW &amp;lt;Window name&amp;gt;] [INVOKE] &amp;lt;Menu name&amp;gt; [NAME &amp;lt;Menu name&amp;gt;] [TITLE &amp;lt;Menu title&amp;gt;] [SHORTCUT &amp;lt;Menu shortcut&amp;gt;] [ADD|REMOVE] [CMD &amp;lt;ARexx command&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MENU WINDOW/K,INVOKE,NAME/K,TITLE/K,SHORTCUT/K,ADD/S,REMOVE/S,CMD/K/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: The following set of parameters can be used solely for invoking menu items.&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window whose menu should be invoked. This can be &amp;quot;ROOT&amp;quot; to work on the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to work on the currently active Workbench window or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: INVOKE&lt;br /&gt;
:: Name of the menu to invoke. See below for a list of available menu items.&lt;br /&gt;
&lt;br /&gt;
: The following set of parameters are for adding and removing menu items.&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the menu item to add or remove. Each menu item must have a name with which it is associated. The name must be unique and has nothing to do with the title of the item, as shown in the Tools&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
: TITLE&lt;br /&gt;
:: This is the text that will be used as the menu item title, as it will appear in the Tools&amp;quot; menu. This parameter is required if you ADD a new menu item.&lt;br /&gt;
&lt;br /&gt;
: SHORTCUT&lt;br /&gt;
:: When adding a new menu item, this will be the menu shortcut associated with the item. Please note that the shortcut cannot be longer than a single character and that it will be ignored if there already is an item in any of the menus which uses this shortcut. This parameter is optional.&lt;br /&gt;
&lt;br /&gt;
: ADD&lt;br /&gt;
:: This tells the MENU command to add a new item to the &amp;quot;Tools&amp;quot; menu. When adding a menu item you will also need to specify the NAME, TITLE and CMD parameters.&lt;br /&gt;
&lt;br /&gt;
: REMOVE&lt;br /&gt;
:: This tells the MENU command to remove a menu item previously added via the ARexx interface. When removing a menu item you will also need to specify the NAME parameter.&lt;br /&gt;
&lt;br /&gt;
: CMD&lt;br /&gt;
:: This is the ARexx command to bind to the new menu item. The command can either be the name of an ARexx script to execute or a short ARexx program in a single line.&lt;br /&gt;
&lt;br /&gt;
: Menu items:&lt;br /&gt;
: WORKBENCH.BACKDROP&lt;br /&gt;
:: Toggles the Workbench &amp;quot;Backdrop&amp;quot; window switch.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.EXECUTE&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Execute Command&amp;quot; requester. The user will be prompted to enter the command to be executed.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.REDRAWALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Redraw All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.UPDATEALL&lt;br /&gt;
:: Invokes the Workbench &amp;quot;Update All&amp;quot; function.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.LASTMESSAGE&lt;br /&gt;
:: Redisplays the last Workbench error message.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.ABOUT&lt;br /&gt;
:: Displays the &amp;quot;Workbench About...&amp;quot; requester.&lt;br /&gt;
&lt;br /&gt;
: WORKBENCH.QUIT&lt;br /&gt;
:: Attempts to close Workbench; this may bring up a requester the user will have to answer.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.NEWDRAWER&lt;br /&gt;
:: Prompts the user to enter the name of a new drawer to be created.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.OPENPARENT&lt;br /&gt;
:: If possible, this will open the parent directory of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLOSE&lt;br /&gt;
:: If possible, this will close the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.UPDATE&lt;br /&gt;
:: This will update the drawer the command operates on, i.e. the contents will be reread.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SELECTCONTENTS&lt;br /&gt;
:: This will select the contents of the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEARSELECTION&lt;br /&gt;
:: This unselects all icons selected in the drawer the command operates on.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.COLUMN&lt;br /&gt;
:: This will sort the contents of the drawer and place the icons in columns.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.NAME&lt;br /&gt;
:: This will sort the contents of the drawer by name and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.DATE&lt;br /&gt;
:: This will sort the contents of the drawer by date and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.SIZE&lt;br /&gt;
:: This will sort the contents of the drawer by size and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.CLEANUPBY.TYPE&lt;br /&gt;
:: This will sort the contents of the drawer by type and place the icons in rows.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.RESIZETOFIT&lt;br /&gt;
:: This will resize the drawer window, trying to make it just as large as to allow all its icons to fit.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.WINDOW&lt;br /&gt;
:: This will snapshot the drawer window, but none of its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SNAPSHOT.ALL&lt;br /&gt;
:: This will snapshot the drawer window and its contents.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ONLYICONS&lt;br /&gt;
:: This will change the display mode of the drawer to show only files and drawers which have icons attached.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.SHOW.ALLFILES&lt;br /&gt;
:: This will change the display mode of the drawer to show all files and drawers, regardless of whether they have icons attached or not.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.ICON&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents as icons.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.NAME&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by name.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.DATE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by date.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.SIZE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by size.&lt;br /&gt;
&lt;br /&gt;
: WINDOW.VIEWBY.TYPE&lt;br /&gt;
:: This will change the display mode of the drawer to show its contents in textual format, sorted by type.&lt;br /&gt;
&lt;br /&gt;
: ICONS.OPEN&lt;br /&gt;
:: This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.&lt;br /&gt;
&lt;br /&gt;
: ICONS.COPY&lt;br /&gt;
:: This will duplicate the currently selected icons.&lt;br /&gt;
&lt;br /&gt;
: ICONS.RENAME&lt;br /&gt;
:: This will prompt the user to choose a new name for each currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.INFORMATION&lt;br /&gt;
:: This will open the information window for every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.SNAPSHOT&lt;br /&gt;
:: This will lock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.UNSNAPSHOT&lt;br /&gt;
:: This will unlock the position of every currently selected icon.&lt;br /&gt;
&lt;br /&gt;
: ICONS.LEAVEOUT&lt;br /&gt;
:: This will permanently put all currently selected icons on the Workbench root window.&lt;br /&gt;
&lt;br /&gt;
: ICONS.PUTAWAY&lt;br /&gt;
:: This will move all currently selected icons out of the root window and put them back into the drawers they belong.&lt;br /&gt;
&lt;br /&gt;
: ICONS.DELETE&lt;br /&gt;
:: This will cause all currently selected files to be deleted, provided the user confirms this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.FORMATDISK&lt;br /&gt;
:: This will invoke the &amp;quot;Format&amp;quot; command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.&lt;br /&gt;
&lt;br /&gt;
: ICONS.EMPTYTRASH&lt;br /&gt;
:: With a trashcan icon selected, this will empty it.&lt;br /&gt;
&lt;br /&gt;
: TOOLS.RESETWB&lt;br /&gt;
:: This will close and reopen all Workbench windows.&lt;br /&gt;
&lt;br /&gt;
: The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the &amp;quot;Open&amp;quot; menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Invoke the &amp;quot;About&amp;quot; menu. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MENU WINDOW root INVOKE WORKBENCH.ABOUT&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the ARexx script by the name &amp;quot;test.wb&amp;quot;&lt;br /&gt;
 * to be executed. ARexx will search for that program&lt;br /&gt;
 * in the &amp;quot;REXX:&amp;quot; directory. If no &amp;quot;test.wb&amp;quot; file can&lt;br /&gt;
 * be found, ARexx will attempt to execute a script&lt;br /&gt;
 * by the name of &amp;quot;test.rexx&amp;quot;. */&lt;br /&gt;
MENU ADD NAME test1 TITLE ,&amp;quot;Execute a script&amp;quot;, SHORTCUT ,&#039;!&#039; CMD ,&#039;test&#039;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause a short inline program to be executed. */&lt;br /&gt;
MENU ADD NAME test2 TITLE ,&amp;quot;Short inline program&amp;quot;, CMD &amp;quot;say 42&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Add an item to the &amp;quot;Tools&amp;quot; menu; selecting it&lt;br /&gt;
 * will cause the Workbench &amp;quot;About&amp;quot; menu item to be invoked. */&lt;br /&gt;
MENU ADD NAME test3 TITLE ,&amp;quot;About...&amp;quot;, CMD &amp;quot;MENU INVOKE WORKBENCH.ABOUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/* Remove the first menu item we added above. */&lt;br /&gt;
MENU REMOVE NAME test1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= MOVEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the position of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: MOVEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[LEFTEDGE] &amp;lt;new left edge position&amp;gt;] [[TOPEDGE] &amp;lt;new top edge position&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: MOVEWINDOW WINDOW,LEFTEDGE/N,TOPEDGE/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to move the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to move the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: LEFTEDGE&lt;br /&gt;
:: New left edge window position.&lt;br /&gt;
&lt;br /&gt;
: TOPEDGE&lt;br /&gt;
:: New top edge window position.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be moved; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Move the root window to position 10,30. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
MOVEWINDOW root LEFTEDGE 10 TOPEDGE 30&lt;br /&gt;
&lt;br /&gt;
/* Move the currently active window. */&lt;br /&gt;
MOVEWINDOW active 20 40 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NEWDRAWER command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for creating new drawers.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: NEWDRAWER [NAME] &amp;lt;Name of drawer to create&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: NEWDRAWER NAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: NAME&lt;br /&gt;
:: Name of the drawer to be created.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named drawer could not be created.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The drawer name given must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot; will not work.&lt;br /&gt;
&lt;br /&gt;
; Example :&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Create a drawer by the name of &amp;quot;Empty&amp;quot; in the RAM disk. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
NEWDRAWER &#039;RAM:Empty&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RENAME command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for renaming files, drawers and volumes.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RENAME [OLDNAME] &amp;lt;Name of file/drawer/volume to rename&amp;gt; [NEWNAME] &amp;lt;New name of the file/drawer/volume&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RENAME OLDNAME/A,NEWNAME/A&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: OLDNAME&lt;br /&gt;
:: Name of the file/drawer/volume to be renamed. This must be an absolute path, such as in &amp;quot;RAM:Empty&amp;quot;. A relative path, such as &amp;quot;/fred/barney&amp;quot;, will not work.&lt;br /&gt;
&lt;br /&gt;
: NEWNAME&lt;br /&gt;
:: The new name to assign to the file/drawer/volume. This must not be an absolute or relative path. For example, &amp;quot;wilma&amp;quot; is valid new name, &amp;quot;/wilma&amp;quot; or &amp;quot;wilma:&amp;quot; would be invalid names.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the object cannot be renamed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: The RENAME command does not work like for example the AmigaDOS &amp;quot;Rename&amp;quot; command. For example, RENAME &#039;ram:empty&#039; ,&#039;newname&#039; will rename the file &#039;RAM:empty&#039; to &#039;RAM:newname&#039;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Rename a drawer by the name of &amp;quot;Old&amp;quot; in the RAM disk to &amp;quot;New&amp;quot;. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RENAME &#039;RAM:Old&#039; &#039;New&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RX command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command is for executing ARexx scripts and commands.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: RX [CONSOLE] [ASYNC] [CMD] &amp;lt;Command to execute&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: RX CONSOLE/S,ASYNC/S,CMD/A/F&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: CONSOLE&lt;br /&gt;
:: This switch indicates that a console (for default I/O) is needed.&lt;br /&gt;
&lt;br /&gt;
: ASYNC&lt;br /&gt;
:: This switch indicates that the command should be run asynchronously, i.e. the &amp;quot;RX&amp;quot; command will return as soon as ARexx has been instructed to run the command you specified. Otherwise, the &amp;quot;RX&amp;quot; command will wait for the specified ARexx command to complete execution.&lt;br /&gt;
&lt;br /&gt;
: COMMAND&lt;br /&gt;
:: This is the name of the ARexx program to execute.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the given ARexx program could not be executed.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Execute an ARexx program by the name of &#039;test.wb&#039;;&lt;br /&gt;
 * its output should be sent to a console window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
RX CONSOLE CMD &#039;test.wb&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= SIZEWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt to change the size of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: SIZEWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [[WIDTH] &amp;lt;new window width&amp;gt;] [[HEIGHT] &amp;lt;new window height&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: SIZEWINDOW WINDOW,WIDTH/N,HEIGHT/N&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to resize the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to resize the currently active Workbench window or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: WIDTH&lt;br /&gt;
:: New window width.&lt;br /&gt;
&lt;br /&gt;
: HEIGHT&lt;br /&gt;
:: New window height.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be resized; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window resized that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window size to 200100 pixels. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
SIZEWINDOW root 30 WIDTH 200 HEIGHT 100&lt;br /&gt;
&lt;br /&gt;
/* Resize the currently active window. */&lt;br /&gt;
SIZEWINDOW active 200 100 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNLOCKGUI command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will allow access to all Workbench drawer windows locked with the LOCKGUI command.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNLOCKGUI&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: It takes as many UNLOCKGUI commands as there were LOCKGUI commands to make the Workbench drawer windows usable again. In other words, the LOCKGUI command &amp;quot;nests&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Reallow access to all Workbench drawer windows. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNLOCKGUI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UNZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will attempt return a window to its original position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: UNZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: UNZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
UNZOOMWINDOW root&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= VIEW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change the position of the viewable display area of a window.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: VIEW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt; [PAGE|PIXEL] [UP|DOWN|LEFT|RIGHT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: VIEW WINDOW,PAGE/S,PIXEL/S,UP/S,DOWN/S,LEFT/S,RIGHT/S&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Either &amp;quot;ROOT&amp;quot; to change the Workbench root window view (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; to change the currently active Workbench window view or the fully qualified name of a drawer window to change. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
: UP&lt;br /&gt;
:: Move the view up by about 1/8 of the window height. If PAGE is specified, moves the view up by a whole page. If PIXEL is specified, moves the view up by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: DOWN&lt;br /&gt;
:: Move the view down by about 1/8 of the window height. If PAGE is specified, moves the view down by a whole page. If PIXEL is specified, moves the view down by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: LEFT&lt;br /&gt;
:: Move the view left by about 1/8 of the window height. If PAGE is specified, moves the view left by a whole page. If PIXEL is specified, moves the view left by a single pixel.&lt;br /&gt;
&lt;br /&gt;
: RIGHT&lt;br /&gt;
:: Move the view right by about 1/8 of the window height. If PAGE is specified, moves the view right by a whole page. If PIXEL is specified, moves the view right by a single pixel.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window view cannot be changed; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as the window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window view changed that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
: To find out about a window`s current view position, use the GETATTR command and query the window`s WINDOW.VIEW.LEFT and WINDOW.VIEW.TOP attributes.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window view; move it up by a whole page. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
VIEW root PAGE UP &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change, open, close or snapshot windows.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOW [WINDOWS] &amp;lt;Window name&amp;gt; .. &amp;lt;Window name&amp;gt; [OPEN|CLOSE] [SNAPSHOT] [ACTIVATE] [MIN|MAX] [FRONT|BACK] [CYCLE PREVIOUS|NEXT]&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOW WINDOWS/M/A,OPEN/S,CLOSE/S,SNAPSHOT/S,ACTIVATE/S,MIN/S,MAX/S, FRONT/S,BACK/S,CYCLE/K&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOWS&lt;br /&gt;
:: Names of the windows to operate on. This can be &amp;quot;ROOT&amp;quot; to for the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; for the currently active Workbench window or the fully qualified name of a drawer window.&lt;br /&gt;
&lt;br /&gt;
: OPEN&lt;br /&gt;
:: Attempt to open the specified windows.&lt;br /&gt;
&lt;br /&gt;
: CLOSE&lt;br /&gt;
:: Close the specified windows. Note that if a window is closed no further operations (such as SNAPSHOT, ACTIVATE, etc.) can be performed on it.&lt;br /&gt;
&lt;br /&gt;
: SNAPSHOT&lt;br /&gt;
:: Snapshot the sizes and positions of the specified windows.&lt;br /&gt;
&lt;br /&gt;
: ACTIVATE&lt;br /&gt;
:: Activate the specified windows. With multiple windows to activate, only one window will wind up as the active one. Commonly, this will be the last window in the list.&lt;br /&gt;
&lt;br /&gt;
: MIN&lt;br /&gt;
:: Resize the windows to their minimum dimensions.&lt;br /&gt;
&lt;br /&gt;
: MAX&lt;br /&gt;
:: Resize the windows to their maximum dimensions.&lt;br /&gt;
&lt;br /&gt;
: FRONT&lt;br /&gt;
:: Move the windows into the foreground.&lt;br /&gt;
&lt;br /&gt;
: BACK&lt;br /&gt;
:: Move the windows into the background.&lt;br /&gt;
&lt;br /&gt;
: CYCLE&lt;br /&gt;
:: This command operates on the currently active drawer window. You can specify either &amp;quot;PREVIOUS&amp;quot;, to activate the previous drawer window in the list, or &amp;quot;NEXT&amp;quot;, to activate the next following drawer window in the list.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named windows cannot be opened or operated on; this can also happen if you specified &amp;quot;ACTIVE&amp;quot; as a window name and none of the Workbench windows is currently active. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window operated on that is neither the root nor the active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Open the &amp;quot;Work:&amp;quot; drawer. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOW &#039;Work:&#039; OPEN&lt;br /&gt;
&lt;br /&gt;
/* Activate the root window. */&lt;br /&gt;
WINDOW root ACTIVATE &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOBACK command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will push a window into the background.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOBACK [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOBACK WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to push the the Workbench root window (where volume icons and AppIcons live) into to the background, &amp;quot;ACTIVE&amp;quot; to push the currently active Workbench window into the background or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window pushed into the background that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Push the root window into the background. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOBACK root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= WINDOWTOFRONT command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will bring a window to the foreground.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: WINDOWTOFRONT [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: WINDOWTOFRONT WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: &amp;quot;ROOT&amp;quot; to bring the the Workbench root window (where volume icons and AppIcons live) to the foreground, &amp;quot;ACTIVE&amp;quot; to bring the currently active Workbench window to the foreground or the fully qualified name of a drawer window. Note that the drawer window must already be open.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Notes:&lt;br /&gt;
: If you choose to have a window brought to the foreground that is not the root window or the currently active window you must make sure that the window name is given as a fully qualified path name. For example &amp;quot;Work:&amp;quot; is a fully qualified name, and so is &amp;quot;SYS:Utilities&amp;quot;. &amp;quot;Devs/Printers&amp;quot; would not be a fully qualified name. A fully qualified name always contains the name of an assignment, a volume or a device.&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Bring the root window to the foreground. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
WINDOWTOFRONT root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ZOOMWINDOW command =&lt;br /&gt;
&lt;br /&gt;
; Purpose:&lt;br /&gt;
: This command will change a window to alternate position and dimensions.&lt;br /&gt;
&lt;br /&gt;
; Format:&lt;br /&gt;
: ZOOMWINDOW [WINDOW] &amp;lt;ROOT|ACTIVE|Drawer name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Template:&lt;br /&gt;
: ZOOMWINDOW WINDOW&lt;br /&gt;
&lt;br /&gt;
; Parameters:&lt;br /&gt;
: WINDOW&lt;br /&gt;
:: Name of the window to operate on. &amp;quot;ROOT&amp;quot; will use the Workbench root window (where volume icons and AppIcons live), &amp;quot;ACTIVE&amp;quot; will use the currently active Workbench window. Any other fully qualified path name will use the drawer window corresponding to the path.&lt;br /&gt;
:: If no WINDOW parameter is specified, this command will try to operate on the currently active Workbench window.&lt;br /&gt;
&lt;br /&gt;
; Errors:&lt;br /&gt;
: 10 - If the named window cannot be found. The error code will be placed in the WORKBENCH.LASTERROR variable.&lt;br /&gt;
&lt;br /&gt;
; Result:&lt;br /&gt;
: -&lt;br /&gt;
&lt;br /&gt;
; Example:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Change the root window. */&lt;br /&gt;
ADDRESS workbench&lt;br /&gt;
&lt;br /&gt;
ZOOMWINDOW root &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Glossary&amp;diff=6894</id>
		<title>AmigaOS Manual: ARexx Glossary</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Glossary&amp;diff=6894"/>
		<updated>2014-01-28T02:59:10Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This glossary provides definitions of terms used in the ARexx manual.&lt;br /&gt;
&lt;br /&gt;
; Address&lt;br /&gt;
: An identifying number assigned to every byte of information in a computer&#039;s memory and every sector on a disk.&lt;br /&gt;
&lt;br /&gt;
; argument&lt;br /&gt;
: An additional piece of information included with an instruction or function. The argument determines the action to be taken.&lt;br /&gt;
&lt;br /&gt;
; assignment clause&lt;br /&gt;
: A variable symbol (simple, stem or compound symbol) followed by an = operator. In an assignment clause, the tokens to the right of the = sign are evaluated and the result is assigned to the variable symbol.&lt;br /&gt;
&lt;br /&gt;
; Boolean&lt;br /&gt;
: Having two possible states: 0 (false) or 1 (true).&lt;br /&gt;
&lt;br /&gt;
; clause&lt;br /&gt;
: The smallest executable language unit.&lt;br /&gt;
&lt;br /&gt;
; clip list&lt;br /&gt;
: A clipboard used for intertask communication. Name and value pairs can be added to the clip list with the SETCLIP() function.&lt;br /&gt;
&lt;br /&gt;
; command clause&lt;br /&gt;
: An ARexx expression in which the result is issued as a command to an external application.&lt;br /&gt;
&lt;br /&gt;
; command interface&lt;br /&gt;
: A message port through which ARexx issues commands to compatible applications.&lt;br /&gt;
&lt;br /&gt;
; comment&lt;br /&gt;
: A group of characters enclosed in /*...*/ symbols. Each ARexx program starts with a comment.&lt;br /&gt;
&lt;br /&gt;
; compound symbol&lt;br /&gt;
: A token made up of alphanumeric or ., !, ?, $, _ characters with one or more periods within the name. Compound symbols have the structure stem.n1.n2...nk.&lt;br /&gt;
&lt;br /&gt;
; concatenation&lt;br /&gt;
: The process of linking together two strings.&lt;br /&gt;
&lt;br /&gt;
; debugging&lt;br /&gt;
: Finding and fixing errors in a program.&lt;br /&gt;
&lt;br /&gt;
; delimiter&lt;br /&gt;
: A character that marks the beginning and end of a string. ARexx delimiters are a single quote (&#039;) and a double quote (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
; expression&lt;br /&gt;
: A group of tokens to be evaluated. Expressions are made up of strings, symbols, operators, and parentheses.&lt;br /&gt;
&lt;br /&gt;
; fixed symbol&lt;br /&gt;
: A token beginning with a digit or a period.&lt;br /&gt;
&lt;br /&gt;
; function&lt;br /&gt;
: A group of statements that can be executed as a whole. Functions allow you to build complex programs from smaller modules.&lt;br /&gt;
&lt;br /&gt;
; function hosts&lt;br /&gt;
: An external application that contains an ARexx port. The name of a function host is the name of the program&#039;s public message port.&lt;br /&gt;
&lt;br /&gt;
; function libraries&lt;br /&gt;
: A collection of one or more functions organized as an Amiga shared library. A function library must contain a library name, a search priority, an entry point offset, and a version number.&lt;br /&gt;
&lt;br /&gt;
; global environment&lt;br /&gt;
: The fixed components of an ARexx program, including the program source code, static data strings and argument strings.&lt;br /&gt;
&lt;br /&gt;
; host address&lt;br /&gt;
: In an outside application, the host address is the name of the message port to which ARexx commands can be sent.&lt;br /&gt;
&lt;br /&gt;
; instruction&lt;br /&gt;
: A clause beginning with a certain keyword that tells ARexx to perform an action.&lt;br /&gt;
&lt;br /&gt;
; interprocess communication&lt;br /&gt;
: The exchange of information between applications.&lt;br /&gt;
&lt;br /&gt;
; interrupts&lt;br /&gt;
: Internal flags in ARexx that allow a program to detect errors and retain control when the program would normally abort. Interrupts are controlled by the SIGNAL: instruction.&lt;br /&gt;
&lt;br /&gt;
; iterating&lt;br /&gt;
: Repeating a section of a program.&lt;br /&gt;
&lt;br /&gt;
; label&lt;br /&gt;
: A symbol token followed by a colon (:). Labels identify a particular location in the program.&lt;br /&gt;
&lt;br /&gt;
; library list&lt;br /&gt;
: An internal list, maintained by ARexx, of all the currently available function libraries and function hosts. Applications can add or remove functions as needed.&lt;br /&gt;
&lt;br /&gt;
; macro&lt;br /&gt;
: Another name for an ARexx program.&lt;br /&gt;
&lt;br /&gt;
; marker&lt;br /&gt;
: A token that determines the beginning and end of a parse string.&lt;br /&gt;
&lt;br /&gt;
; message port&lt;br /&gt;
: An interface in an Amiga application that allows the program to communicate with an ARexx program.&lt;br /&gt;
&lt;br /&gt;
; null clause&lt;br /&gt;
: A blank line or a comment line.&lt;br /&gt;
&lt;br /&gt;
; numeric precision&lt;br /&gt;
: The number of decimal places in an arithmetic result. As the number of decimal places decreases, the result becomes less precise.&lt;br /&gt;
&lt;br /&gt;
; operators&lt;br /&gt;
: A character such as (+), (-), or (|) used in an arithmetic, concatenation, comparison, or logical operation.&lt;br /&gt;
&lt;br /&gt;
; parsing&lt;br /&gt;
: Breaking a string into smaller units.&lt;br /&gt;
&lt;br /&gt;
; return code&lt;br /&gt;
: The severity level of an error. This number (5, 10, or 20) is displayed when an error occurs in an ARexx program.&lt;br /&gt;
&lt;br /&gt;
; RexxMast&lt;br /&gt;
: The program that acts as an interpreter for ARexx programs.&lt;br /&gt;
&lt;br /&gt;
; simple symbol&lt;br /&gt;
: A token that does not begin with a digit or contain any periods.&lt;br /&gt;
&lt;br /&gt;
; statement&lt;br /&gt;
: An assignment, instruction, or command clause.&lt;br /&gt;
&lt;br /&gt;
; stem symbol&lt;br /&gt;
: A token that has one period at the end of its name. Stem symbols are used to initialize compound symbols.&lt;br /&gt;
&lt;br /&gt;
; storage environment&lt;br /&gt;
: The variable components of an ARexx program, including the symbol table, numeric options, trace options and host address strings.&lt;br /&gt;
&lt;br /&gt;
; string&lt;br /&gt;
: A group of characters beginning and ending with a delimiter (single or double quote). The value of a string is the string itself.&lt;br /&gt;
&lt;br /&gt;
; symbol&lt;br /&gt;
: Any group of the alphanumeric characters a-z, A-Z, 0-9, period (.), exclamation point (!), question mark (?), dollar sign ($), or underscore (_).&lt;br /&gt;
&lt;br /&gt;
; symbol table&lt;br /&gt;
: An internal table created by ARexx that stores the value strings that have been assigned to the variables in a program.&lt;br /&gt;
&lt;br /&gt;
; target&lt;br /&gt;
: A symbol, usually a variable symbol, that is assigned a value during a parsing operation.&lt;br /&gt;
&lt;br /&gt;
; template&lt;br /&gt;
: A group of tokens that specifies the variables used in a parsing operation. It also specifies the way in which the values will be determined.&lt;br /&gt;
&lt;br /&gt;
; tokenization&lt;br /&gt;
: The process of breaking a statement into its individual tokens.&lt;br /&gt;
&lt;br /&gt;
; tokens&lt;br /&gt;
: The smallest entities of the ARexx language.&lt;br /&gt;
&lt;br /&gt;
; tracing&lt;br /&gt;
: Displaying the lines of an ARexx program as the program is executing. This allows you to determine exactly where any errors are occurring.&lt;br /&gt;
&lt;br /&gt;
; variable&lt;br /&gt;
: A symbol that can be assigned a value.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Command_Utilities&amp;diff=6893</id>
		<title>AmigaOS Manual: ARexx Command Utilities</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Command_Utilities&amp;diff=6893"/>
		<updated>2014-01-28T02:47:59Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ARexx provides a number of command utilities, located in the REXXC Directory, that provide various control functions. These are executable modules that can be run from the Shell and are relevant only when the ARexx resident process is active.&lt;br /&gt;
&lt;br /&gt;
= HI =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HI&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the global halt flag, which causes all active ARexx programs to receive an external halt request. Each program will exit immediately unless its HALT interrupt has been enabled. The halt flag does not remain set, but is cleared automatically after all current programs have received the request.&lt;br /&gt;
&lt;br /&gt;
= RX =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RX name [arguments]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launches an ARexx program. If the specified name includes an explicit path, only that directory is searched for the program; otherwise, the current directory and REXX: are checked for a program with the given name. The optional argument string is passed to the program.&lt;br /&gt;
&lt;br /&gt;
= RXSET =&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RXSET [name [[=] value]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a (name,value) pair to the Clip List. Name strings are assumed to be in mixed case. If a pair with the same name already exists, its value is replaced with the current string. If a name without a value string is given, the entry is removed from the Clip List. If RXSET is invoked without arguments, it will list all (name, value) pairs in the Clip List.&lt;br /&gt;
&lt;br /&gt;
= RXC =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RXC&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Close the resident process. The &amp;quot;REXX&amp;quot; public port is withdrawn immediately, and the resident process exits as soon as the last ARexx program finishes. No new programs can be launched after a close request.&lt;br /&gt;
&lt;br /&gt;
= TCC =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TCC&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the global tracing console as soon as all active programs are no longer using it. All read requests queued to the console must be satisfied before it can be closed.&lt;br /&gt;
 &lt;br /&gt;
= TCO =&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TCO&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens the global tracing console. The tracing output from all active programs is diverted automatically to the new console. The console window can be moved and resized by the user and can be closed with the TCC command.&lt;br /&gt;
&lt;br /&gt;
= TE =&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TE&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears the global tracing flag, which forces the tracing mode to OFF for all active ARexx programs.&lt;br /&gt;
&lt;br /&gt;
= TS =&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TS&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starts interactive tracing by setting the external trace flag, which forces all active ARexx programs into interactive tracing mode. Programs will start producing trace output and will pause after the next statement. This command is useful for regaining control over programs caught in infinite loops or otherwise misbehaving. The trace flag remains set until cleared by the TE command, so subsequent program invocations will be executed in interactive tracing mode. &lt;br /&gt;
&lt;br /&gt;
= WaitForPort =&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WaitForPort [name of port]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
WaitForPort waits 10 seconds for the specified port to appear. A return code of 0 indicates that the port was found. A return code of 5 indicates that the application is not currently running or that the port does not exist. Port names are case sensitive. For example:&lt;br /&gt;
&lt;br /&gt;
 WaitForPort ED_1&lt;br /&gt;
 WaitForPort MyPort&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Error_Messages&amp;diff=6892</id>
		<title>AmigaOS Manual: ARexx Error Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Error_Messages&amp;diff=6892"/>
		<updated>2014-01-28T00:28:29Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When the ARexx interpreter detects an error in a program, it returns an error code to indicate the nature of the problem. Errors are normally handled by displaying the error code, the source line number where the error occurred and a brief message explaining the error condition. Unless the SYNTAX interrupt has been previously enabled (using the SIGNAL instruction), the program then terminates and control returns to the caller. Most syntax and execution errors can be trapped by the SYNTAX interrupt, allowing the user to retain and perform whatever special error processing is required. Certain errors are generated outside of the context of an ARexx program and therefore cannot be trapped by this mechanism. Refer to Chapter 6 for further information on error trapping and processing.&lt;br /&gt;
&lt;br /&gt;
Each error code is associated with a severity level that is reported to the calling program as the primary result code. The values of these results codes are 5 (least serious), 10 (moderately serious), and 20 (very serious). The error code itself is returned as the secondary result. The subsequent propagation or reporting of these codes is dependent on the external (calling) program.&lt;br /&gt;
&lt;br /&gt;
The following pages list all of the currently-defined error codes, along with the associated result code and message strings.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table A-1. Error Codes and Messages&lt;br /&gt;
! Error !! Result Code !! Message !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 5 || Program not found || The named program could not be found or was not an ARexx program. ARexx program are expected to start with a comment (/*...*/). This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 10 || Execution halted || A Ctrl+C break or an external halt request was received and the program terminated. This error will be trapped if the HALT interrupt has been enabled.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 20 || Insufficient memory || The interpreter was unable to allocate enough memory for an operation. Since memory space is required for all parsing and execution operations, this error cannot usually be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 10 || Invalid character || A non-ASCII character was found in the program. Control codes and other non-ASCII characters may be used in a program by defining them as hex or binary strings. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 10 || Unmatched quote || A closing single or double quote was missing. Check that each string is properly delimited. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 10 || Unterminated comment || The closing */ of a comment was not found. Remember that comments may be nested, so each /* must be matched by a */. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 10 || Clause too long || A clause was too long for the internal buffer. The source line should be broken into smaller parts. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 10 || Invalid token || An unrecognized lexical token was found, or a clause could not be properly classified. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || 10 || Symbol or string too long || An attempt was made to create a string longer than the maximum allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 10 || Invalid message packet || An invalid action code was found in a message packet sent to the ARexx resident process. The packet was returned without being processed. This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 10 || Command string error || A command string could not be processed. This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || 10 || Error return from function || An external function returned a non-zero error code. Check that the correct parameters were supplied to the function.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || 10 || Host environment not found || The message port corresponding to a host address string could not be found. Check that the required external host is active.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || 10 || Requested library not found || An attempt was made to open a function library included in the Library List, but the library could not be opened. Check that the correct name and version of the library were specified when the library was added to the resource list.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || 10 || Function not found || A function was called that could not be found in any of the currently accessible libraries and could not be located as an external program. Check that the appropriate function libraries have been added to the Libraries List.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || 10 || Function did not return a value || A function was called which failed to return a result string, but did not otherwise report an error. Check that the function was programmed correctly or invoke it using the CALL instruction.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || 10 || Wrong number of arguments || A call was made to a function which expected a different number of arguments. This error will be generated if a built-in or external function is called with more arguments than can be accommodated in the message packet used for external communications.&lt;br /&gt;
|-&lt;br /&gt;
| 18 || 10 || Invalid argument to function || An inappropriate argument was supplied to a function or a required argument was missing. Check the parameter requirements specified for the function.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || 10 || Invalid PROCEDURE || A PROCEDURE instruction was issued in an invalid context. Either no internal functions were active or a PROCEDURE had already been issued in the current storage environment.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || 10 || Unexpected THEN or WHEN || A WHEN or THEN instruction was executed outside of a valid context. The WHEN instruction is valid only within a SELECT range, and THEN must be the next instruction following in IF or WHEN.&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 10 || Unexpected ELSE or OTHERWISE || An ELSE or OTHERWISE was found outside of a valid context. The OTHERWISE instruction is valid only within a SELECT range. ELSE is valid only following the THEN branch of an IF range.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || 10 || Unexpected BREAK, LEAVE or ITERATE || The BREAK instruction is valid only within a DO range or inside an INTERPRETed string. The LEAVE and ITERATE instructions are valid only within an iterative DO range.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || 10 || Invalid statement in SELECT || An invalid statement was encountered within a SELECT range. Only WHEN, THEN and OTHERWISE statements are valid within a SELECT range, except for the conditional statements following THEN or OTHERWISE clauses.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || 10 || Missing or multiple THEN || An expected THEN clause was not found or another THEN was found after one had already been executed.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || 10 || Missing OTHERWISE || None of the WHEN clauses in a SELECT succeeded, but no OTHERWISE clause was supplied.&lt;br /&gt;
|-&lt;br /&gt;
| 26 || 10 || Missing or unexpected END || The program source ended before an END was found for a DO or SELECT instruction, or an END was encountered outside a DO or SELECT range.&lt;br /&gt;
|-&lt;br /&gt;
| 27 || 10 || Symbol mismatch || The symbol specified on an END, ITERATE or LEAVE instruction did not match the index variable for the DO range. Check that the active loops have been nested properly.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || 10 || Invalid DO syntax || An invalid DO instruction was executed. An initializer expression must be given if a TO or BY expression is specified. A FOR expression must yield a non-negative integer result.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || 10 || Incomplete IF or SELECT || An IF or SELECT range ended before all of the required statements were found. Check whether the conditional statement following a THEN, ELSE or OTHERWISE clause was omitted.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 10 || Label not found || A label specified by a SIGNAL instruction or implicitly referenced by an enabled interrupt could not be found in the program source. Labels defined dynamically by an INTERPRET instruction or by interactive input are not included in the search.&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 10 || Symbol expected || A non-symbol token was found where only a symbol token is valid. The DROP, END, LEAVE, ITERATE and UPPER instructions may only be followed by a symbol token. This message will also be issued if a required symbol is missing.&lt;br /&gt;
|-&lt;br /&gt;
| 32 || 10 || Symbol or string expected || An invalid token was found in a context where only a symbol or string is valid.&lt;br /&gt;
|-&lt;br /&gt;
| 33 || 10 || Invalid keyword || A symbol token in an instruction clause was identified as a keyword, but was invalid in the specific context.&lt;br /&gt;
|-&lt;br /&gt;
| 34 || 10 || Required keyword missing || An instruction clause required a specific keyword token to be present, but it was not supplied. This message will be issued if a SIGNAL ON instruction is not followed by one of the interrupt keywords (e.g., SYNTAX).&lt;br /&gt;
|-&lt;br /&gt;
| 35 || 10 || Extraneous characters || A seemingly valid statement was executed, but extra characters were found at the end of the clause.&lt;br /&gt;
|-&lt;br /&gt;
| 36 || 10 || Keyword conflict || Two mutually exclusive keywords were included in an instruction clause, or a keyword was included twice in the same instruction.&lt;br /&gt;
|-&lt;br /&gt;
| 37 || 10 || Invalid template || The template provided with an ARG, PARSE or PULL instruction was not properly constructed.&lt;br /&gt;
|-&lt;br /&gt;
| 38 || 10 || Invalid TRACE request || The alphabetic keyword supplied with a TRACE instruction or as the argument to the TRACE() built-in function was not valid.&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 10 || Uninitialized variable || An attempt was made to use an uninitialized variable while the NOVALUE interrupt was enabled.&lt;br /&gt;
|-&lt;br /&gt;
| 40 || 10 || Invalid variable || An attempt was made to assign a value to a fixed symbol.&lt;br /&gt;
|-&lt;br /&gt;
| 41 || 10 || Invalid expression || An error was detected during the evaluation of an expression. Check that each operator has the correct number of operands and that no extraneous tokens appear in the expression. This error will be detected only in expressions that are actually evaluated. No checking is performed on expressions in clauses that are being skipped.&lt;br /&gt;
|-&lt;br /&gt;
| 42 || 10 || Unbalanced parentheses || An expression was found with an unequal number of opening and closing parentheses.&lt;br /&gt;
|-&lt;br /&gt;
| 43 || 10 || Nesting limit exceeded || The number of subexpressions in an expression was greater than the maximum allowed. Simplify the expression by breaking it into two or more intermediate expressions.&lt;br /&gt;
|-&lt;br /&gt;
| 44 || 10 || Invalid expression result || The result of an expression was not valid within its context. This message will be issued if an increment or limit expression in a DO instruction yields a non-numeric result.&lt;br /&gt;
|-&lt;br /&gt;
| 45 || 10 || Expression required || An expression was omitted in a context where one is required. For example, the SIGNAL instruction, if not followed by the keywords ON or OFF, must be followed by an expression.&lt;br /&gt;
|-&lt;br /&gt;
| 46 || 10 || Boolean value not 0 or 1 || An expression result was expected to yield a Boolean result, but evaluated to something other than 0 or 1.&lt;br /&gt;
|-&lt;br /&gt;
| 47 || 10 || Arithmetic conversion error || A non-numeric operand was used in an operation requiring numeric operands. This message will also be generated by an invalid hex or binary string.&lt;br /&gt;
|-&lt;br /&gt;
| 48 || 10 || Invalid operand || An operand was not valid for the intended operation. This message will be generated if an attempt is made to divide by 0 or if a fractional exponent is used in an exponentiation operation.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Error_Messages&amp;diff=6891</id>
		<title>AmigaOS Manual: ARexx Error Messages</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Error_Messages&amp;diff=6891"/>
		<updated>2014-01-28T00:25:56Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When the ARexx interpreter detects an error in a program, it returns an error code to indicate the nature of the problem. Errors are normally handled by displaying the error code, the source line number where the error occurred and a brief message explaining the error condition. Unless the SYNTAX interrupt has been previously enabled (using the SIGNAL instruction), the program then terminates and control returns to the caller. Most syntax and execution errors can be trapped by the SYNTAX interrupt, allowing the user to retain and perform whatever special error processing is required. Certain errors are generated outside of the context of an ARexx program and therefore cannot be trapped by this mechanism. Refer to Chapter 6 for further information on error trapping and processing.&lt;br /&gt;
&lt;br /&gt;
Each error code is associated with a severity level that is reported to the calling program as the primary result code. The values of these results codes are 5 (least serious), 10 (moderately serious), and 20 (very serious). The error code itself is returned as the secondary result. The subsequent propagation or reporting of these codes is dependent on the external (calling) program.&lt;br /&gt;
&lt;br /&gt;
The following pages list all of the currently-defined error codes, along with the associated result code and message strings.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table A-1. Error Codes and Messages&lt;br /&gt;
! Error !! Result Code !! Message !! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 5 || Program not found || The named program could not be found or was not an ARexx program. ARexx program are expected to start with a comment (/*...*/). This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 10 || Execution halted || A Ctrl+C break or an external halt request was received and the program terminated. This error will be trapped if the HALT interrupt has been enabled.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 20 || Insufficient memory || The interpreter was unable to allocate enough memory for an operation. Since memory space is required for all parsing and execution operations, this error cannot usually be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 10 || Invalid character || A non-ASCII character was found in the program. Control codes and other non-ASCII characters may be used in a program by defining them as hex or binary strings. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 10 || Unmatched quote || A closing single or double quote was missing. Check that each string is properly delimited. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 10 || Unterminated comment || The closing */ of a comment was not found. Remember that comments may be nested, so each /* must be matched by a */. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 10 || Clause too long || A clause was too long for the internal buffer. The source line should be broken into smaller parts. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 10 || Invalid token || An unrecognized lexical token was found, or a clause could not be properly classified. This is a scan-phase error and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || 10 || Symbol or string too long || An attempt was made to create a string longer than the maximum allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 10 || Invalid message packet || An invalid action code was found in a message packet sent to the ARexx resident process. The packet was returned without being processed. This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 10 || Command string error || A command string could not be processed. This error is detected by the external interface and cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || 10 || Error return from function || An external function returned a non-zero error code. Check that the correct parameters were supplied to the function.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || 10 || Host environment not found || The message port corresponding to a host address string could not be found. Check that the required external host is active.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || 10 || Requested library not found || An attempt was made to open a function library included in the Library List, but the library could not be opened. Check that the correct name and version of the library were specified when the library was added to the resource list.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || 10 || Function not found || A function was called that could not be found in any of the currently accessible libraries and could not be located as an external program. Check that the appropriate function libraries have been added to the Libraries List.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || 10 || Function did not return a value || A function was called which failed to return a result string, but did not otherwise report an error. Check that the function was programmed correctly or invoke it using the CALL instruction.&lt;br /&gt;
|-&lt;br /&gt;
| 17 || 10 || Wrong number of arguments || A call was made to a function which expected a different number of arguments. This error will be generated if a built-in or external function is called with more arguments than can be accommodated in the message packet used for external communications.&lt;br /&gt;
|-&lt;br /&gt;
| 18 || 10 || Invalid argument to function || An inappropriate argument was supplied to a function or a required argument was missing. Check the parameter requirements specified for the function.&lt;br /&gt;
|-&lt;br /&gt;
| 19 || 10 || Invalid PROCEDURE || A PROCEDURE instruction was issued in an invalid context. Either no internal functions were active or a PROCEDURE had already been issued in the current storage environment.&lt;br /&gt;
|-&lt;br /&gt;
| 20 || 10 || Unexpected THEN or WHEN || A WHEN or THEN instruction was executed outside of a valid context. The WHEN instruction is valid only within a SELECT range, and THEN must be the next instruction following in IF or WHEN.&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 10 || Unexpected ELSE or OTHERWISE || An ELSE or OTHERWISE was found outside of a valid context. The OTHERWISE instruction is valid only within a SELECT range. ELSE is valid only following the THEN branch of an IF range.&lt;br /&gt;
|-&lt;br /&gt;
| 22 || 10 || Unexpected BREAK, LEAVE or ITERATE || The BREAK instruction is valid only within a DO range or inside an INTERPRETed string. The LEAVE and ITERATE instructions are valid only within an iterative DO range.&lt;br /&gt;
|-&lt;br /&gt;
| 23 || 10 || Invalid statement in SELECT || An invalid statement was encountered within a SELECT range. Only WHEN, THEN and OTHERWISE statements are valid within a SELECT range, except for the conditional statements following THEN or OTHERWISE clauses.&lt;br /&gt;
|-&lt;br /&gt;
| 24 || 10 || Missing or multiple THEN || An expected THEN clause was not found or another THEN was found after one had already been executed.&lt;br /&gt;
|-&lt;br /&gt;
| 25 || 10 || Missing OTHERWISE || None of the WHEN clauses in a SELECT succeeded, but no OTHERWISE clause was supplied.&lt;br /&gt;
|-&lt;br /&gt;
| 26 || 10 || Missing or unexpected END || The program source ended before an END was found for a DO or SELECT instruction, or an END was encountered outside a DO or SELECT range.&lt;br /&gt;
|-&lt;br /&gt;
| 27 || 10 || Symbol mismatch || The symbol specified on an END, ITERATE or LEAVE instruction did not match the index variable for the DO range. Check that the active loops have been nested properly.&lt;br /&gt;
|-&lt;br /&gt;
| 28 || 10 || Invalid DO syntax || An invalid DO instruction was executed. An initializer expression must be given if a TO or BY expression is specified. A FOR expression must yield a non-negative integer result.&lt;br /&gt;
|-&lt;br /&gt;
| 29 || 10 || Incomplete IF or SELECT || An IF or SELECT range ended before all of the required statements were found. Check whether the conditional statement following a THEN, ELSE or OTHERWISE clause was omitted.&lt;br /&gt;
|-&lt;br /&gt;
| 30 || 10 || Label not found || A label specified by a SIGNAL instruction or implicitly referenced by a enabled interrupt could not be found in the program source. Labels defined dynamically by an INTERPRET instruction or by interactive input are not included in the search.&lt;br /&gt;
|-&lt;br /&gt;
| 31 || 10 || Symbol expected || A non-symbol token was found where only a symbol token is valid. The DROP, END, LEAVE, ITERATE and UPPER instructions may only be followed by a symbol token. This message will also be issued if a required symbol is missing.&lt;br /&gt;
|-&lt;br /&gt;
| 32 || 10 || Symbol or string expected || An invalid token was found in a context where only a symbol or string is valid.&lt;br /&gt;
|-&lt;br /&gt;
| 33 || 10 || Invalid keyword || A symbol token in an instruction clause was identified as a keyword, but was invalid in the specific context.&lt;br /&gt;
|-&lt;br /&gt;
| 34 || 10 || Required keyword missing || An instruction clause required a specific keyword token to be present, but it was not supplied. This message will be issued if a SIGNAL ON instruction is not followed by one of the interrupt keywords (e.g., SYNTAX).&lt;br /&gt;
|-&lt;br /&gt;
| 35 || 10 || Extraneous characters || A seemingly valid statement was executed, but extra characters were found at the end of the clause.&lt;br /&gt;
|-&lt;br /&gt;
| 36 || 10 || Keyword conflict || Two mutually exclusive keywords were included in an instruction clause, or a keyword was included twice in the same instruction.&lt;br /&gt;
|-&lt;br /&gt;
| 37 || 10 || Invalid template || The template provided with an ARG, PARSE or PULL instruction was not properly constructed.&lt;br /&gt;
|-&lt;br /&gt;
| 38 || 10 || Invalid TRACE request || The alphabetic keyword supplied with a TRACE instruction or as the argument to the TRACE() built-in function was not valid.&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 10 || Uninitialized variable || An attempt was made to use an uninitialized variable while the NOVALUE interrupt was enabled.&lt;br /&gt;
|-&lt;br /&gt;
| 40 || 10 || Invalid variable || An attempt was made to assign a value to a fixed symbol.&lt;br /&gt;
|-&lt;br /&gt;
| 41 || 10 || Invalid expression || An error was detected during the evaluation of an expression. Check that each operator has the correct number of operands and that no extraneous tokens appear in the expression. This error will be detected only in expressions that are actually evaluated. No checking is performed on expressions in clauses that are being skipped.&lt;br /&gt;
|-&lt;br /&gt;
| 42 || 10 || Unbalanced parentheses || An expression was found with an unequal number of opening and closing parentheses.&lt;br /&gt;
|-&lt;br /&gt;
| 43 || 10 || Nesting limit exceeded || The number of subexpressions in an expression was greater than the maximum allowed. Simplify the expression by breaking it into two or more intermediate expressions.&lt;br /&gt;
|-&lt;br /&gt;
| 44 || 10 || Invalid expression result || The result of an expression was not valid within its context. This message will be issued if an increment or limit expression in a DO instruction yields a non-numeric result.&lt;br /&gt;
|-&lt;br /&gt;
| 45 || 10 || Expression required || An expression was omitted in a context where one is required. For example, the SIGNAL instruction, if not followed by the keywords ON or OFF, must be followed by an expression.&lt;br /&gt;
|-&lt;br /&gt;
| 46 || 10 || Boolean value not 0 or 1 || An expression result was expected to yield a Boolean result, but evaluated to something other than 0 or 1.&lt;br /&gt;
|-&lt;br /&gt;
| 47 || 10 || Arithmetic conversion error || A non-numeric operand was used in an operation requiring numeric operands. This message will also be generated by an invalid hex or binary string.&lt;br /&gt;
|-&lt;br /&gt;
| 48 || 10 || Invalid operand || An operand was not valid for the intended operation. This message will be generated if an attempt is made to divide by 0 or if a fractional exponent is used in an exponentiation operation.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Parsing&amp;diff=6890</id>
		<title>AmigaOS Manual: ARexx Parsing</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Parsing&amp;diff=6890"/>
		<updated>2014-01-28T00:01:13Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Parsing extracts substrings from a string and assigns them to variables. Parsing is performed using the PARSE instruction or its variants ARG and PULL. The operation input is called the parse string and comes from several sources, including argument strings, expressions, or the console.&lt;br /&gt;
&lt;br /&gt;
String-manipulation functions like SUBSTR() and INDEX() may be used for parsing, but the PARSE instruction statement is more efficient, especially if extracting many fields from a string.&lt;br /&gt;
&lt;br /&gt;
= Templates =&lt;br /&gt;
&lt;br /&gt;
Parsing is controlled by a template, a group of tokens that specifies both the variables to be given values and the way to determine the value strings. The way tokens are arranged in the template determines whether the token is one of two basic template objects: a marker or a target.&lt;br /&gt;
&lt;br /&gt;
; Marker&lt;br /&gt;
: Determines the starting and ending position in the parse string or the scan position.&lt;br /&gt;
&lt;br /&gt;
; Target&lt;br /&gt;
: A symbol assigned a value by the parsing operation. That value is the substring determined by the marker positions.&lt;br /&gt;
&lt;br /&gt;
== Markers ==&lt;br /&gt;
&lt;br /&gt;
There are three types of marker objects:&lt;br /&gt;
&lt;br /&gt;
; Absolute markers&lt;br /&gt;
: Actual index position in the parse string.&lt;br /&gt;
&lt;br /&gt;
; Relative markers&lt;br /&gt;
: A positive or negative offset from the current position.&lt;br /&gt;
&lt;br /&gt;
; Pattern markers&lt;br /&gt;
: Matches the pattern against the parse string beginning at the current scan position.&lt;br /&gt;
&lt;br /&gt;
== Targets ==&lt;br /&gt;
&lt;br /&gt;
Targets, like markers, can affect the scan position if value strings are being extracted by tokenization. Parsing by tokenization extracts words (tokens) from the parse string and is used whenever a target is followed immediately by another target. During tokenization the current scan position is advanced past any blanks to the start of the next word. The ending index is the position just past the end of the word and the value string has neither leading nor trailing blanks.&lt;br /&gt;
&lt;br /&gt;
Targets are specified by variable symbols. The place holder, denoted by a period (.), is a special type of target and behaves like a normal target except that it does not have an assigned value.&lt;br /&gt;
&lt;br /&gt;
=== Template Objects ===&lt;br /&gt;
&lt;br /&gt;
Each template object is specified by one or more tokens:&lt;br /&gt;
&lt;br /&gt;
; Symbols&lt;br /&gt;
: A symbol may specify a target or a marker. It&#039;s a marker if it follows an operator (+, - or =) and the symbol value is used as an absolute or relative position. Symbols enclosed in parentheses specify pattern markers, and the symbol value is used as the pattern string. It specifies a target if neither of the preceding cases applies and the symbol is variable. Fixed symbols always specify absolute markers and must be whole numbers. The only exception is the place holder (.) target.&lt;br /&gt;
&lt;br /&gt;
; Strings&lt;br /&gt;
: A string always represents a pattern marker.&lt;br /&gt;
&lt;br /&gt;
; Parentheses&lt;br /&gt;
: A symbol enclosed in parentheses is a pattern marker and the value of the symbol is used as the pattern string. While the symbol may be either fixed or variable, it will usually be a variable. A fixed pattern could be given more simply as a string.&lt;br /&gt;
&lt;br /&gt;
; Operators&lt;br /&gt;
: The three operators (+, - and =) are valid within a template and must be followed by a fixed or variable symbol. The value of the symbol is used as a marker and must represent a whole number. The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; operators signify a relative marker, whose value is negated by the &amp;quot;-&amp;quot; operator. The &amp;quot;=&amp;quot; operator indicates an absolute marker and is optional if the marker is defined by a fixed symbol.&lt;br /&gt;
&lt;br /&gt;
; Commas&lt;br /&gt;
: The comma (,) marks the end of a template. It is also used as a separator when multiple templates are provided with an instruction. The interpreter obtains a new parse string before processing each succeeding template. For some source options, the new string will be identical to the previous one. The ARG, EXTERNAL and PULL options will generally supply a different string, as will the VAR option if the variable has been modified.&lt;br /&gt;
&lt;br /&gt;
The ARexx interface command parser has been generalized to recognize double-delimiter sequences within a (quoted) string file. The quoting convention is convenient for short programs, but it is easy to run out of quoting levels in longer programs. Single and double-quotes within a REXX program are equivalent, but the external environment may make a distinction.&lt;br /&gt;
&lt;br /&gt;
AmigaDOS uses double-quotes. Strings entered from a Shell must begin with a double-quote, especially if you wish to include semicolons. For example:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
RX &amp;quot;SAY &#039;It&#039;&#039;s possible, indeed; you ain&#039;&#039;t seen nothin&#039;&#039; yet!&#039; &amp;quot;&lt;br /&gt;
-&amp;gt; It&#039;s possible, indeed; you ain&#039;t seen nothin&#039; yet!&lt;br /&gt;
&lt;br /&gt;
RX &amp;quot;SAY &#039;&amp;quot;&amp;quot;Hello!&amp;quot;&amp;quot;&#039;&amp;quot;-&amp;gt; &amp;quot;Hello!&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= The Scanning Process =&lt;br /&gt;
&lt;br /&gt;
Scan positions are expressed as an index in the parse string and can range from 1 (the start of the string) to the length of the string plus 1 (the end).&lt;br /&gt;
&lt;br /&gt;
The substring specified by two scan indices includes the characters from the starting position up to, but not including, the ending position. For example, the indices 1 and 10 specify characters 1-9 in the parse string. If the second scan index is less than or equal to the first, the remainder of the parse string is used as the substring. This means that a template specification like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PARSE ARG 1 all 1 first second&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will assign the entire parse string to the variable ALL. If the current scan index is already at the end of the parse string, the remainder is the null string.&lt;br /&gt;
&lt;br /&gt;
When a pattern marker is matched against the parse string, the marker position is the index of the first character of the matched pattern or the end of the string if no match was found. The pattern is removed from the string whenever a match is found. This is the only operation that modifies the parse string during the parsing process.&lt;br /&gt;
&lt;br /&gt;
Templates are scanned from left to right with the initial scan index set to 1. The scan position is updated each time a marker object is encountered, according to the type and value of the marker.&lt;br /&gt;
&lt;br /&gt;
Whenever a target object is found, the assigned value is determined by examining the next template object. If the next object is another target, the value string is determined by tokenizing the parse string. Otherwise, the current scan position is used as the start of the value string and the position specified by the following marker is used as the end point.&lt;br /&gt;
&lt;br /&gt;
The scan continues until all of the objects in the template have been used. Every target will be assigned a value. Once the parse string has been exhausted, the null string is assigned to any remaining targets.&lt;br /&gt;
&lt;br /&gt;
= Parsing Examples =&lt;br /&gt;
&lt;br /&gt;
== Parsing by Tokenization ==&lt;br /&gt;
&lt;br /&gt;
Computer programs frequently split a string into its component words or tokens. This is accomplished with a template consisting entirely of variables (targets).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &amp;quot;hammer 1 each $600.00&amp;quot; was entered*/&lt;br /&gt;
PULL item qty units cost .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example the input line from the PULL instruction is split into words and assigned to the variables in the template. The variable item receives the value &amp;quot;hammer&amp;quot;, qty is set to &amp;quot;1&amp;quot;, units is set to &amp;quot;each&amp;quot; and cost gets the value &amp;quot;$600.00&amp;quot;. The final place holder (.) is given a null value, since there are only four words in the input. However, it forces the preceding variable cost to be given a tokenized value. If the place holder were omitted, the remainder of the parse string would be assigned to cost, which would then have a leading blank.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
answer = &amp;quot;Only Amiga makes it possible.&amp;quot;&lt;br /&gt;
DO forever&lt;br /&gt;
   PARSE VAR answer first answer&lt;br /&gt;
   /*Place first word into &#039;first&#039; and the rest into &#039;answer&#039;.*/&lt;br /&gt;
   IF first ==&#039;&#039; THEN LEAVE&lt;br /&gt;
   /*Stop if there are no more words*/&lt;br /&gt;
   SAY answer&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first word of a string is removed and the remainder is placed back in the string. The process continues until no more words are extracted. The output is:&lt;br /&gt;
&lt;br /&gt;
 Amiga makes it possible.&lt;br /&gt;
 makes it possible.&lt;br /&gt;
 it possible.&lt;br /&gt;
 possible.&lt;br /&gt;
&lt;br /&gt;
== Parsing by Pattern ==&lt;br /&gt;
&lt;br /&gt;
Pattern markers extract the desired fields. The &amp;quot;pattern&amp;quot; in this case is very simple - a single character - but could be an arbitrary string of any length. This form of parsing is useful whenever delimiter characters are present in the parse string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume an argument string &amp;quot;12, 35.5,1&amp;quot; */&lt;br /&gt;
ARG hours &#039;,&#039; rate &#039;,&#039; withhold&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The pattern is actually removed from the parse string when a match is found. If the parse string is scanned again from the beginning, the length and structure of the string may be different than at the start of the parsing process. The original source of the string, however, is never modified.&lt;br /&gt;
&lt;br /&gt;
== Parsing by Positional Markers ==&lt;br /&gt;
&lt;br /&gt;
Parsing with positional markers is used whenever the files of interest are known to be in certain positions in a string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* Records look like: */&lt;br /&gt;
/* Start: 1-5 */&lt;br /&gt;
/* Length: 6-10 */&lt;br /&gt;
/* Name: @ (start,length)*/&lt;br /&gt;
PARSE value record with 1 start +5 length +5 =start name +length&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The records being processed contain a variable length field. The starting position and length of the field are given in the first part of the record with a variable positional marker used to extract the desired field.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;=start&amp;quot; sequence is an absolute marker whose value is the position placed in the variable start earlier in the scan. The &amp;quot;+length&amp;quot; sequence supplies the effective length of the field.&lt;br /&gt;
&lt;br /&gt;
== Multiple Templates ==&lt;br /&gt;
&lt;br /&gt;
More than one template can be specified with an instruction by separating the templates with a comma. The ARG instruction (or PARSE UPPER ARG) accesses the argument strings provided when the program was called. Each template accesses the succeeding argument string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments are (&#039;one two&#039;,12,sort)*/&lt;br /&gt;
ARG first second,amount,action,option&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first template consists of the variables first and second, which are set to the values &amp;quot;one&amp;quot; and &amp;quot;two&amp;quot;. In the next two templates, amount gets the value &amp;quot;12&amp;quot; and action is set to &amp;quot;SORT&amp;quot;. The last template consists of the variable &amp;quot;option&amp;quot;, which is set to the null string, since only three arguments were available.&lt;br /&gt;
&lt;br /&gt;
When multiple templates are used with the EXTERNAL or PULL source options, each additional template requests an additional line of input from the user:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Read last, first, and middle names and ssn*/&lt;br /&gt;
PULL last &#039;,&#039; first middle,ssn&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two lines of input are read. The first input line is expected to have three words which are assigned to the variables &amp;quot;last&amp;quot;, &amp;quot;first&amp;quot;, and &amp;quot;middle&amp;quot;: The first variable is followed by a comma. The entire second input line is assigned to the variable &amp;quot;ssn&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Multiple templates can be useful even with a source option that returns the identical parse string. If the first template included pattern markers that altered the parse string, the subsequent templates could still access the original string. Subsequent parse strings obtained from the VALUE source do not cause the expression to be re-evaluated, but only retrieve the prior result.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Debugging&amp;diff=6889</id>
		<title>AmigaOS Manual: ARexx Debugging</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Debugging&amp;diff=6889"/>
		<updated>2014-01-27T23:39:26Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ARexx provides tracing and source-level debugging facilities. Tracing displays selected statements in a program as the program executes. When a clause is traced, its line number, source text, and related information are displayed on the console.&lt;br /&gt;
&lt;br /&gt;
The internal interrupt system enables an ARexx program to detect certain synchronous or asynchronous events and to take special actions when they occur. Events such as a syntax error or an external halt request that would normally cause the program to exit can instead be trapped so that corrective actions can be taken.&lt;br /&gt;
&lt;br /&gt;
= Tracing =&lt;br /&gt;
&lt;br /&gt;
The tracing action selects which source clauses will be traced and has two modifier flags that control command inhibition and interactive tracing. Trace options can be shortened to one letter. The Trace options are:&lt;br /&gt;
&lt;br /&gt;
; ALL&lt;br /&gt;
: All clauses are traced.&lt;br /&gt;
&lt;br /&gt;
; BACKGROUND&lt;br /&gt;
: No tracing is performed and the program cannot be forced into interactive tracing.&lt;br /&gt;
&lt;br /&gt;
; COMMANDS&lt;br /&gt;
: All command clauses are traced before being sent to the external host. Non-zero return codes are displayed on the console.&lt;br /&gt;
&lt;br /&gt;
; ERRORS&lt;br /&gt;
: Commands that generate a non-zero return code are traced after the clause is executed.&lt;br /&gt;
&lt;br /&gt;
; INTERMEDIATES&lt;br /&gt;
: All clauses are traced and intermediate results are displayed during expression evaluation. These include the values retrieved for variables, expanded compound names, and the results of function calls.&lt;br /&gt;
&lt;br /&gt;
; LABELS&lt;br /&gt;
: All label clauses are traced as they are executed. A label will be displayed each time a transfer of control takes place&lt;br /&gt;
&lt;br /&gt;
; NORMAL (Default)&lt;br /&gt;
: Command clauses with return codes that exceed the current error failure level are traced after execution and an error message is displayed.&lt;br /&gt;
&lt;br /&gt;
; OFF&lt;br /&gt;
: Tracing is turned off.&lt;br /&gt;
&lt;br /&gt;
; RESULTS&lt;br /&gt;
: All clauses are traced before execution and the final result of each expression is displayed. Values assigned to variables by ARG, PARSE or PULL instructions are also displayed. This option is recommended for general-purpose testing.&lt;br /&gt;
&lt;br /&gt;
; SCAN&lt;br /&gt;
: This is a special option that traces all clauses and checks for errors, but suppresses the actual execution of the statements. If is helpful as a preliminary screening step for a newly-created program.&lt;br /&gt;
&lt;br /&gt;
The tracing mode can be set using either the TRACE instruction or the TRACE() built-in function. Tracing can be selectively disabled from within a program to skip previously tested parts of a program.&lt;br /&gt;
&lt;br /&gt;
Each trace line displayed on the console is indented to show the effective control (nesting) level at that clause and is identified by a special three-character code, as shown in Table 6-1. The source for each clause is preceded by its line number in the program.&lt;br /&gt;
&lt;br /&gt;
Expression results or intermediates are enclosed in double quotes so that leading and trailing blanks will be apparent.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 6-1. Special Three Character Codes&lt;br /&gt;
! Code !! Displayed Values&lt;br /&gt;
|-&lt;br /&gt;
| +++ || Command or syntax error&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;C&amp;gt; || Expanded compound name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;F&amp;gt; || Result of a function call&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;L&amp;gt; || Label clause&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;O&amp;gt; || Result of a dyadic operation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;P&amp;gt; || Result of a prefix operation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;U&amp;gt; || Uninitialized variable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;V&amp;gt; || Value of a variable&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;&amp;gt;&amp;gt; || Expression or template result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;.&amp;gt; || &amp;quot;Place holder&amp;quot; token value &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tracing Output ==&lt;br /&gt;
&lt;br /&gt;
The tracing output from a program is always directed to one of two logical streams. The interpreter first checks for a stream named STDERR and directs the output there if the stream exists.&lt;br /&gt;
&lt;br /&gt;
Otherwise, the trace output goes to the standard output stream STDOUT and will be interleaved with the normal console output of the program. The STDERR and STDOUT streams can be opened and closed under program control, so the programmer has complete control over the destination of tracing output.&lt;br /&gt;
&lt;br /&gt;
In some cases a program may not have a predefined output stream. For example, a program invoked from a host application that did not provide input and output streams would not have an output console. To provide a tracing facility for such programs, the resident process can open a special global tracing console for use by any active program. When this console opens, the interpreter automatically opens a stream named STDERR for each ARexx program in which STDERR is not currently defined. The program then diverts its tracing output to the new stream.&lt;br /&gt;
&lt;br /&gt;
A global tracing console can be opened using the TCO command utility. ARexx programs will automatically divert their tracing output to the new window, which is opened as a standard AmigaDOS console. The user can move it and resize it as required.&lt;br /&gt;
&lt;br /&gt;
The tracing console also serves as the input stream for programs during interactive tracing. When a program pauses for tracing input, the input must be entered at the trace console. Any number of programs may use the tracing console simultaneously, although it is recommended that only one program at a time be traced.&lt;br /&gt;
&lt;br /&gt;
The global console can be closed using the TCC command. The closing is delayed until all read requests to the console have been satisfied. Only when all of the active programs indicate that they are no longer using the console will it actually be closed.&lt;br /&gt;
&lt;br /&gt;
== Command Inhibition ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a tracing mode called command inhibition that suppresses host commands. In this mode command clauses are evaluated in the normal manner, but the command is not actually sent to the external host, and the return code is set to zero. This provides a way to test programs that issue potentially destructive commands, such as erasing files or formatting disks. Command inhibition does not apply to command clauses that are entered interactively. These commands are always performed, but the value of the special variable RC is left unchanged.&lt;br /&gt;
&lt;br /&gt;
Command inhibition may be used in conjunction with any trace option. It is controlled by the &amp;quot;!&amp;quot; character, which may appear by itself or may precede any of the alphabetic options in a TRACE instruction. Each occurrence of the &amp;quot;!&amp;quot; character &amp;quot;toggles&amp;quot; the inhibition mode currently in effect. Command inhibition is cleared when tracing is set to OFF.&lt;br /&gt;
&lt;br /&gt;
== Interactive Tracing ==&lt;br /&gt;
&lt;br /&gt;
Interactive tracing is a debugging facility that allows the user to enter source statements while a program is executing. These statements may be used to examine or modify variable values, issue commands, or otherwise interact with the program. Any valid language statements can be entered interactively, with the same rules and restrictions that apply to the INTERPRET instruction. In particular, compound statements such as DO and SELECT must be complete within the entered line.&lt;br /&gt;
&lt;br /&gt;
Interactive tracing can be used with any of the trace options. While in interactive tracing mode, the interpreter pauses after each traced clause and prompts for input with the code &amp;quot;+++&amp;quot;. At each pause, three types of user responses are possible:&lt;br /&gt;
&lt;br /&gt;
* If a null line is entered, the program continues to the next pause point.&lt;br /&gt;
* If a &amp;quot;=&amp;quot; character is entered, the preceding clause is executed again.&lt;br /&gt;
* Any other input is treated as a debugging statement and is scanned and executed.&lt;br /&gt;
&lt;br /&gt;
The interpreter pauses after traceable clauses. Tracing options determine the location of the pauses. The interpreter does not pause after the instructions CALL, DO, ELSE, IF, THEN, and OTHERWISE. When any clause generates an execution error, the interpreter exits the program.&lt;br /&gt;
&lt;br /&gt;
Interactive tracing is controlled by the &amp;quot;?&amp;quot; character, either by itself or in combination with an alphabetic trace option. Any number of &amp;quot;?&amp;quot; characters may precede an option. Each occurrence toggles the mode currently in effect. For example, if the current trace option was NORMAL, &amp;quot;TRACE ?R&amp;quot; would set the option to RESULTS and select interactive tracing mode. A subsequent &amp;quot;TRACE ?&amp;quot; would turn off interactive tracing.&lt;br /&gt;
&lt;br /&gt;
=== Error Processing ===&lt;br /&gt;
&lt;br /&gt;
The ARexx interpreter provides error processing during debugging. Errors found during interactive debugging are reported, but do not terminate the program. This special processing only applies to statements entered interactively.&lt;br /&gt;
&lt;br /&gt;
ARexx also disables the internal interrupt flags during interactive debugging. This prevents an accidental transfer of control due to an error or uninitialized variable. However, if a &amp;quot;SIGNAL label&amp;quot; instruction is entered, the transfer will take place and any remaining interactive input will be abandoned. The SIGNAL instruction can still be used to alter the interrupt flags, and the new setting will take effect when the interpreter returns to normal processing.&lt;br /&gt;
&lt;br /&gt;
Each ARexx task initializes its command failure level to the client&#039;s failure level (usually 10) to suppress printing of nuisance command errors. The failure level can be changed using OPTIONS FAILAT. Command errors (RC &amp;gt; 0) and failure (RC &amp;gt;= FAILAT) can be separately trapped using SIGNAL ON ERROR and SIGNAL ON FAILURE.&lt;br /&gt;
&lt;br /&gt;
=== The External Tracing Flag ===&lt;br /&gt;
&lt;br /&gt;
ARexx has an external tracing flag used to force programs into interactive tracing mode. When this tracing flag is set, using the TS command utility, any program not already in interactive tracing mode will enter it immediately. The internal trace option is set to RESULTS unless it is currently set to INTERMEDIATES or SCAN, in which case it remains unchanged. Programs invoked while the external tracing flags is set will begin executing in interactive tracing mode.&lt;br /&gt;
&lt;br /&gt;
The external tracing flag provides a way to regain control over looping or unresponsive programs. Once a program enters interactive tracing mode, the user can step through the program statements and diagnose the problem. External tracing is a global flag, so all currently-active programs are affected by it. The tracing flag remains set until it is cleared using the TE command utility. Each program maintains an internal copy of the last state of the tracing flag and sets its tracing option to OFF when it observes that the tracing flag has been cleared. Programs in BACKGROUND tracing mode do not respond to the external tracing flag. &lt;br /&gt;
&lt;br /&gt;
= Interrupts =&lt;br /&gt;
&lt;br /&gt;
ARexx maintains an internal interrupt system used to detect and trap certain error conditions. When an interrupt is enabled and its corresponding condition arises, a transfer of control to the label specific to that interrupt occurs. This allows a program to retain control in circumstances that might otherwise cause the program to terminate. The interrupt conditions can be caused by either synchronous events, like a syntax error, or asynchronous events, like a Ctrl+C break request.&lt;br /&gt;
&lt;br /&gt;
{{Note|These internal interrupts are completely separate from the hardware interrupt system managed by the EXEC operating system.}}&lt;br /&gt;
&lt;br /&gt;
The name assigned to each interrupt is actually the label to which control will be transferred. Thus, a SYNTAX interrupt will transfer control to the label &amp;quot;SYNTAX:&amp;quot;. Interrupts can be enabled or disabled using the SIGNAL instruction. For example, the instruction &amp;quot;SIGNAL ON SYNTAX&amp;quot; would enable the SYNTAX interrupt.&lt;br /&gt;
&lt;br /&gt;
The interrupts supported by ARexx are:&lt;br /&gt;
&lt;br /&gt;
; BREAK_C&lt;br /&gt;
: This traps (detects and treats as a signal and not as normal output) a Ctrl+C break request generated by AmigaDOS. If the interrupt is not enabled, the program terminates immediately with the error message &amp;quot;Execution halted&amp;quot; and returns with the error code set to 2.&lt;br /&gt;
&lt;br /&gt;
; BREAK_D&lt;br /&gt;
: This traps a Ctrl+D break request issued by AmigaDOS. The break request is ignored if the interrupt is not enabled.&lt;br /&gt;
&lt;br /&gt;
; BREAK_E&lt;br /&gt;
: This traps a Ctrl+E break request issued by AmigaDOS. The break request is ignored if the interrupt is not enabled.&lt;br /&gt;
&lt;br /&gt;
; BREAK_F&lt;br /&gt;
: This traps a Ctrl+F break request issued by AmigaDOS. The break request is ignored if the interrupt is not enabled.&lt;br /&gt;
&lt;br /&gt;
; ERROR&lt;br /&gt;
: This interrupt is generated by any host command that returns a non-zero code.&lt;br /&gt;
&lt;br /&gt;
; HALT&lt;br /&gt;
: An external halt request is trapped if this interrupt is enabled. Otherwise, the program terminates immediately with the error message &amp;quot;Execution halted&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; IOERR&lt;br /&gt;
: Errors detected by the I/O system are trapped if this interrupt is enabled.&lt;br /&gt;
&lt;br /&gt;
; NOVALUE&lt;br /&gt;
: An interrupt occurs if an uninitialized variable is used while this condition is enabled. The usage could be within an expression, in the UPPER instruction, or with the VALUE() built-in function.&lt;br /&gt;
&lt;br /&gt;
; SYNTAX&lt;br /&gt;
: A syntax or execution error is generated by this interrupt. Not all such errors can be trapped. Certain errors occur before a program is executed and those detected by the ARexx external interface cannot be trapped by the SYNTAX interrupt.&lt;br /&gt;
&lt;br /&gt;
When an interrupt forces a transfer of control, all of the currently active control ranges are dismantled and the interrupt that caused the transfer is disabled. This disabling prevents a possible recursive interrupt loop. Only the control structures in the current environment are affected, so an interrupt generated within a function will not affect the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
Two special variables are affected when an interrupt occurs:&lt;br /&gt;
&lt;br /&gt;
; SIGL&lt;br /&gt;
: Always set to the current line number before the transfer of control takes place. This allows the determination of which source line is executed.&lt;br /&gt;
&lt;br /&gt;
; RC&lt;br /&gt;
: Set to the error code that caused the condition. For ERROR interrupts, this value will be a command return code and can usually be interpreted as an error severity level. The value for SYNTAX interrupts is always an ARexx error code.&lt;br /&gt;
&lt;br /&gt;
Interrupts are useful for error-recovery actions. This involves informing external programs that an error occurred or reporting further diagnostics to isolate the problem. Program 15 issues a &amp;quot;message&amp;quot; command to an external host called &amp;quot;MyEdit&amp;quot; whenever a syntax error is detected.&lt;br /&gt;
&lt;br /&gt;
== Program 15. Interrupt.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A macro program for &#039;MyEdit&#039;*/&lt;br /&gt;
SIGNAL ON SYNTAX /*Enable interrupt*/&lt;br /&gt;
(normal processing)&lt;br /&gt;
EXIT&lt;br /&gt;
SYNTAX: /*Syntax error detected*/&lt;br /&gt;
ADDRESS &#039;MyEdit&#039;&lt;br /&gt;
&#039;message&#039; &#039;error&#039; RC errortext (RC)&lt;br /&gt;
EXIT 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6888</id>
		<title>AmigaOS Manual: ARexx Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6888"/>
		<updated>2014-01-27T22:36:46Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An instruction clause begins with the name of a particular instruction and tells ARexx to perform a certain action. This chapter provides an alphabetical list of the instructions available in ARexx.&lt;br /&gt;
&lt;br /&gt;
Each instruction keyword may be followed by one or more subkeywords, expressions, or other instruction-specific information. Instruction keywords and subkeywords are recognized only in this specific context. This allows the same keywords to be used in a different context as variables or function names. An instruction keyword cannot be followed by a colon (:) or an equals (=) operator.&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&lt;br /&gt;
The syntax for each instruction is shown to the right of the keyword heading. The conventions used in the syntax are shown in Table 4-1:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 4-1. Syntax Conventions&lt;br /&gt;
! Convention !! Definition&lt;br /&gt;
|-&lt;br /&gt;
| KEYWORD || All keywords and subkeywords are shown in upper case letters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; (vertical bar) || Alternative selections are separated by a vertical bar&lt;br /&gt;
|-&lt;br /&gt;
| { } (braces) || Required alternatives are enclosed by braces&lt;br /&gt;
|-&lt;br /&gt;
| [ ] (brackets) || Optional instruction parts are enclosed in brackets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|The syntax conventions do not apply to the specifications following the keyword heading. They only apply to the syntax shown to the right of the instruction keyword.}}&lt;br /&gt;
&lt;br /&gt;
For example, the format for the CALL instruction is:&lt;br /&gt;
&lt;br /&gt;
 CALL {symbol | string} [expression] [,expression,...]&lt;br /&gt;
&lt;br /&gt;
You must supply a symbol or a string as an argument. The vertical bar identifies the alternative selections, and the braces indicate that the use of an argument is required. The specification of an expression is optional, as indicated by the brackets.&lt;br /&gt;
&lt;br /&gt;
Examples are given at the end of the instruction specification. Explanations or evaluations of the examples are shown as ARexx comments /*...*/.&lt;br /&gt;
&lt;br /&gt;
= Alphabetical Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of ARexx&#039;s built-in instructions. The syntax of each instruction is shown to the right of the instruction keyword.&lt;br /&gt;
&lt;br /&gt;
== ADDRESS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS [[symbol | string] | [VALUE][expressions]] &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction specifies a host address for commands issued by the interpreter. A host address is the name of an application&#039;s message port to which ARexx commands are sent. ARexx maintains two host addresses: a current and a previous value. Whenever a new host address is supplied, the previous address is lost and the current address becomes the previous one. These host addresses are part of a program&#039;s storage environment and are preserved across internal function calls. The current address can be retrieved with the built-in function ADDRESS().&lt;br /&gt;
&lt;br /&gt;
The ADDRESS keyword alone interchanges the current and previous hosts. Repeated execution will toggle between the two host addresses.&lt;br /&gt;
&lt;br /&gt;
ADDRESS {string | symbol]} specifies that the new host address is the string or symbol. The value of the string or symbol is the token itself. Message port names are case-sensitive. The appropriate syntax for a program command to a message port named MyPort is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS &#039;MyPort&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you omit the single quotes around MyPort, ARexx will look for the message port MYPORT and generate an error. The current host address becomes the previous address. An expression specified after a string or symbol is evaluated and the result is issued to the specified host. No changes are made to the current or previous address strings. This provides a convenient way to issue a single command to an external host without disturbing the current host addresses. The return code from the command is treated as it would be from a command clause.&lt;br /&gt;
&lt;br /&gt;
If ADDRESS [VALUE] expression is specified. ARexx uses the result of the expression as the new host address, and the current address becomes the previous address. The VALUE keyword may be omitted if the first token of the expression is not a symbol or string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS /*Swap current and previous address.*/&lt;br /&gt;
ADDRESS edit /*The new host address is EDIT.*/&lt;br /&gt;
ADDRESS edit &#039;top&#039; /*Move to the top.*/&lt;br /&gt;
ADDRESS VALUE edit in /*Compute a new host address.*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ARG ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG is a shorthand form for the PARSE UPPER ARG instruction. It retrieves one or more of the argument strings available to the program and assigns values to the variables in the template. The number of argument strings available depends on whether the program was invoked as a command or a function. Command invocations normally have only one argument string, but functions may have up to 15. The argument strings are not altered by the ARG instruction. ARG returns upper case letters. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARG first,second /*Retrieve arguments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure and processing of templates is described briefly with the PARSE instruction.&lt;br /&gt;
&lt;br /&gt;
== BREAK ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BREAK&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The BREAK instruction is used to exit from the range of a DO instruction or from within an INTERPRETed string. It is valid only in these contexts. If used within a DO statement, BREAK exits from the innermost DO statement containing the BREAK. This contrasts with the similar LEAVE instruction, which exits only from an iterative (repeating) DO. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO /*Begin block*/&lt;br /&gt;
 IF i&amp;gt;3 THEN BREAK /*Finished?*/&lt;br /&gt;
 a = a + 1&lt;br /&gt;
 y.a = name&lt;br /&gt;
 END /*End block*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CALL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CALL {symbol | string} [expressions] [,expression, ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CALL instruction is used to invoke an internal or external function. The function name is specified by the symbol or string token. Any expressions that follow are evaluated and become the arguments to the called function. The value returned by the function is assigned to the special variable RESULT. It is not an error if a result string is not returned. In this case the variable RESULT is DROPped (becomes uninitialized).&lt;br /&gt;
&lt;br /&gt;
The linkage to the function is established dynamically at the time of the call. ARexx follows a specific search order in attempting to locate the called function. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CENTER name, length+4, &#039;+&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CENTER is the called function. The expressions will be evaluated and passed as arguments to CENTER.&lt;br /&gt;
&lt;br /&gt;
== DO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DO [[var=exp] | [exp] [TO exp] [BY exp]] [FOR exp] [FOREVER] [WHILE exp | UNTIL exp]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction begins a group of instructions executed as a block. The range of the DO instruction includes all statements up to and including an eventual END instruction.&lt;br /&gt;
&lt;br /&gt;
If no subkeywords follow the DO instruction, the block is executed once. Subkeywords can be used to iterate the block until a termination condition occurs. An interative DO instruction is sometimes called a loop since ARexx &amp;quot;loops back&amp;quot; to perform the instruction repeatedly. The various parts of the DO instruction are:&lt;br /&gt;
&lt;br /&gt;
* An initializer expression of the form &amp;quot;variable=expression&amp;quot; defines the index variable of the loop. The expression is evaluated when the DO range is first activated and the result is assigned to the index variable. On subsequent iterations an expression of the form &amp;quot;variable = variable + increment&amp;quot; is evaluated, where the increment is the result of the BY expression. If specified, the initializer expression must precede any of the other subkeywords.&lt;br /&gt;
&lt;br /&gt;
* The expression following a BY symbol defines the increment to be added to the index variable in each subsequent iteration. The expression must yield a numeric result, which may be positive or negative and need not be an integer. The default increment is 1.&lt;br /&gt;
&lt;br /&gt;
* The result of the TO expression specifies the upper (or lower) limit for the index variable. At each iteration the index variable is compared to the TO result. If the increment (BY result) is positive and the variable is greater than the limit, the DO instruction terminates and control passes to the statement following the END instruction. The loop also terminates if the increment is negative and the index variable is less than the limit.&lt;br /&gt;
&lt;br /&gt;
* The FOR expression must yield a positive whole number when evaluated and specifies the maximum number of iterations to be performed. The loop terminates when this limit is reached, irrespective of the value of the index variable.&lt;br /&gt;
&lt;br /&gt;
* The initializer BY, TO and FOR expressions are evaluated only when the instruction is first activated, so the increment and limits are fixed through the execution. A limit is not required. For example, the instruction &amp;quot;DO i=1&amp;quot; will simply count away forever.&lt;br /&gt;
&lt;br /&gt;
* The FOREVER keyword can be used if an iterative DO instruction is required but no index variable is necessary. The loop will be terminated by a LEAVE or BREAK instruction contained within the loop.&lt;br /&gt;
&lt;br /&gt;
* The WHILE expression is evaluated at the beginning of each iteration and must result in a Boolean value. The iteration proceeds if the result is 1 (true); otherwise, the loop terminates.&lt;br /&gt;
&lt;br /&gt;
* The UNTIL expression is evaluated at the end of each iteration and must result in a Boolean value. The instruction continues with the next iteration if the result is 0 (false), and terminates otherwise. (WHILE and UNTIL are mutually exclusive.)&lt;br /&gt;
&lt;br /&gt;
=== Program 12. Iteration.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Examples of DO*/&lt;br /&gt;
LIMIT = 20; number = 1&lt;br /&gt;
DO i=1 to LIMIT for 10 WHILE number &amp;lt; 20&lt;br /&gt;
   number = i * number&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
number = number/3.345; i = 0&lt;br /&gt;
DO number for LIMIT/5&lt;br /&gt;
   i = i + 1&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is shown with comment lines for explanation. The comments would not appear on your screen.&lt;br /&gt;
&lt;br /&gt;
 Iteration 1 number = 1 /*1 * 1 = 1*/&lt;br /&gt;
 Iteration 2 number = 2 /*2 * 1 = 2*/&lt;br /&gt;
 Iteration 3 number = 6 /*3 * 2 = 6*/&lt;br /&gt;
 Iteration 4 number = 24 /*4 * 6 = 24*/&lt;br /&gt;
 Iteration 1 number = 7.17488789 /*24/3.345 = 7.17488789*/&lt;br /&gt;
 Iteration 2 number = 7.17488789 /*number doesn&#039;t change*/&lt;br /&gt;
 Iteration 3 number = 7.17488789 /*limit/5 = 20/5 = 4*/&lt;br /&gt;
 Iteration 4 number = 7.17488789 /*operation repeats 4 times*/&lt;br /&gt;
&lt;br /&gt;
{{Note|If a FOR limit is also present, the initial expression is still evaluated, but the result need not be a positive integer.}}&lt;br /&gt;
&lt;br /&gt;
== DROP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DROP variable [variable ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The specified variable symbols are reset to their unintialized state, in which the value of the variable is the variable name itself. It is not an error to DROP a variable that is already uninitialized. DROPping a stem symbol is equivalent to DROPping the values of all possible compound symbols derived from the stem. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
a = 123 /*Assign a value to a */&lt;br /&gt;
DROP a b /*DROP (remove) the values from A and B*/&lt;br /&gt;
SAY a b /*Results in A B.*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ECHO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ECHO [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ECHO instruction is a synonym for the SAY instruction. It displays the expression result on the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ECHO &amp;quot;you don&#039;t say&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ELSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ELSE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ELSE instruction provides the alternative conditional branch for an IF statement. It is valid only within the range of an IF instruction and must follow the conditional statement of the THEN branch. If the THEN branch isn&#039;t executed, the statement following the ELSE clause is performed.&lt;br /&gt;
&lt;br /&gt;
ELSE clauses always bind to the nearest, preceding IF statement. It may be necessary to provide &amp;quot;dummy&amp;quot; ELSE clauses for the inner IF ranges of a compound IF statement to allow alternative branches for the outer IF statements. It is not sufficient to follow the ELSE with a semicolon or a null clause. Instead, the NOP (no-operation) instruction can be used. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i &amp;gt; 2 THEN SAY &#039;Really?&#039;&lt;br /&gt;
ELSE SAY &#039;I thought so&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== END ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;END [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The END instruction terminates the range of a DO or SELECT instruction. If the optional variable symbol is supplied, it is compared to the index variable of the DO statement (which must be iterative). An error is generated if the symbols do not match. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5 /*Index variable is i*/&lt;br /&gt;
   SAY i&lt;br /&gt;
   END i /*End &amp;quot;i&amp;quot; loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EXIT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXIT [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The EXIT instruction terminates the execution of a program. It is valid anywhere within a program. The evaluated expression is passed back to the caller as the function or command result.&lt;br /&gt;
&lt;br /&gt;
The processing of the EXIT result depends on whether a result string was requested by the calling program and whether the current invocation resulted from a command or function call.&lt;br /&gt;
&lt;br /&gt;
* If a result string was requested, the expression result is copied to a block of allocated memory and a pointer to the block is returned as the secondary result of the call.&lt;br /&gt;
&lt;br /&gt;
* If the caller did not request a result string and the program was invoked as a command, an attempt is made to convert the expression result to an integer. This value is then returned as the primary result, with 0 as the secondary result. This allows the EXIT information to be interpreted as a return code by the caller.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
EXIT /*No result needed*/&lt;br /&gt;
EXIT 10 /*An error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IF ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IF expression [THEN] [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF instruction is used in conjunction with THEN and ELSE instructions to conditionally execute a statement. The result of the expression must be a Boolean value. If the result is 1 (True), the statement following the THEN symbol is executed. Otherwise, control passes to the next statement. The THEN keyword need not immediately follow the IF expression, but may appear as a separate clause.&lt;br /&gt;
&lt;br /&gt;
The instruction is analyzed as &amp;quot;IF expression; THEN; statement&amp;quot;. The expression following the IF statement establishes the test condition that determines whether subsequent THEN or ELSE clauses will be performed. Any valid statement may follow the THEN symbol. In particular, a &amp;quot;DO ... END;&amp;quot; group allows a series of statements to be performed conditionally. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF result &amp;lt; 0 THEN exit /*All done?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INTERPRET ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INTERPRET expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The INTERPRET command treats the expression as though it were a source statement block. The expression is evaluated and the result is executed as one or more program statements. The statements are considered as a group, as if surrounded by a &amp;quot;DO ... END&amp;quot; combination. Any statements can be included in the INTERPRETed source, including DO or SELECT instructions. The BREAK instruction can be used to terminate the processing of INTERPRETed statements.&lt;br /&gt;
&lt;br /&gt;
An INTERPRET instruction activates a control range when it is executed, which serves as a boundary for LEAVE and ITERATE instructions. These instructions can only be used with DO loops defined within the INTERPRET. While it is not an error to include label clauses within the interpreted string, only those labels defined in the original program are searched during a transfer of control.&lt;br /&gt;
&lt;br /&gt;
The INTERPRET instruction can be used to construct programs dynamically and then execute them. Program fragments may be passed as arguments to functions, which then INTERPRET the fragments. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
inst = &#039;SAY&#039; /*An instruction*/&lt;br /&gt;
INTERPRET inst hello /*. . . &amp;quot;SAY HELLO&amp;quot;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ITERATE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ITERATE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ITERATE instruction terminates the current iteration of a DO instruction and begins the next iteration. Effectively, control passes to the END statement and then (depending on the outcome of the UNTIL expression) back to the DO statement. The instruction normally acts on the innermost iterative DO range. An error results if the ITERATE instruction is not contained within an iterative DO instruction.&lt;br /&gt;
&lt;br /&gt;
If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   IF i = 3 THEN ITERATE i&lt;br /&gt;
   SAY i&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LEAVE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEAVE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LEAVE forces an immediate exit from the iterative DO range containing the instruction. An error results if the LEAVE instruction is not contained within an iterative DO instruction. If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i = 1 to limit&lt;br /&gt;
   IF i &amp;gt; 5 THEN LEAVE /*Maximum iterations*/&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NOP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NOP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The NOP (NO-oPeration) instruction is provided to control the binding of ELSE clauses in compound IF statements. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i = j THEN           /*First (outer) IF*/&lt;br /&gt;
   IF j = k THEN a = 0  /*Inner IF*/&lt;br /&gt;
      ELSE NOP          /*Binds to inner IF*/&lt;br /&gt;
   ELSE a = a + 1       /*Binds to outer IF*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NUMERIC ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NUMERIC {DIGITS | FUZZ} expression NUMERIC FORM {SCIENTIFIC | ENGINEERING}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The NUMERIC instruction sets options relating to numeric precision and format. The numeric options are preserved when an internal function is called.&lt;br /&gt;
&lt;br /&gt;
* The DIGITS expression option specifies the number of digits of precision for arithmetic calculations. The expression must evaluate to a positive whole number.&lt;br /&gt;
&lt;br /&gt;
* The FUZZ expression option specifies the number of digits to be ignored in numeric comparison operations. This must be a positive whole number, less than the current DIGITS setting.&lt;br /&gt;
&lt;br /&gt;
* The FORM SCIENTIFIC option specifies that numbers that require exponential notation be expressed in scientific notation. The exponent is adjusted so that the mantissa for non-zero number is between 1 and 10. This is the default format.&lt;br /&gt;
&lt;br /&gt;
* The FORM ENGINEERING option selects engineering format for numbers that require exponential notation. Engineering format normalizes a number so that its exponent is a multiple of three and the mantissa (if not 0) is between 1 and 1000.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 12 /*12 digits of precision*/&lt;br /&gt;
NUMERIC FORM SCIENTIFIC /*Result in scientific notation*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPTIONS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [FAILAT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [PROMPT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [RESULTS]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [CACHE]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The OPTIONS instruction is used to set various internal defaults. The FAILAT expression sets the limit at or above which command return codes will be signaled as errors. It must evaluate to an integer value. The PROMPT expression provides a string to be used as the prompt with the PULL (or PARSE PULL) instruction. The RESULTS keyword indicates that the interpreter should request a result string when it issues commands to an external host.&lt;br /&gt;
&lt;br /&gt;
The internal options controlled by this instruction are preserved across function calls, so an OPTIONS instruction can be issued within an internal function without affecting the caller&#039;s environment. If no keyword is specified with the OPTIONS instruction, all controlled options revert to their default settings. The OPTIONS instruction also accepts a NO keyword to reset a selected option to its default value, making it more convenient to reset the RESULTS attribute for a single command without having to reset the FAILAT and PROMPT options.&lt;br /&gt;
&lt;br /&gt;
OPTIONS also accepts a CACHE keyword that can be used to enable or disable an internal statement-caching scheme. The cache is normally enabled. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
OPTIONS FAILAT 10&lt;br /&gt;
OPTIONS PROMPT &amp;quot;Yes Boss?&amp;quot;&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OTHERWISE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OTHERWISE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction is valid only within the range of a SELECT instruction and must follow all of the &amp;quot;WHEN ... THEN&amp;quot; statements. If none of the preceding WHEN clauses has succeeded, the statement following the OTHERWISE instruction is executed. An OTHERWISE is not mandatory within a SELECT range. However, an error will result if the OTHERWISE clause is omitted and none of the WHEN instructions succeeds. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN say &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN say &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PARSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PARSE [UPPER] inputsource [template] [,template ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PARSE instruction provides a mechanism to extract one or more substrings from a string and assign them to variables. The input string can come from a variety of sources, including argument strings, an expression, or from the console.&lt;br /&gt;
&lt;br /&gt;
Parsing is controlled by a template, which may consist of symbols, strings, operators and parentheses. The template provides both the variables to be given values and the way to determine the value strings. During the parsing operation the input string is split into substrings that are assigned to the variable symbols in the template. The process continues until all of the variables in the template have been assigned a value. If the input string is &amp;quot;used up&amp;quot;, any remaining variables are given null values.&lt;br /&gt;
&lt;br /&gt;
When a variable in the template is followed immediately by another variable, the value string is determined by breaking the input string into words separated by blanks. Leading and trailing blanks are not permitted. Each word is assigned to a variable in the template. Normally the last variable receives the untokenized remainder of the input string, since it is not followed by a symbol. A placeholder symbol, a period (.), forces the variable with the period to terminate at the first space in the input stream. Placeholders behave like variables except that they are never assigned a value.&lt;br /&gt;
&lt;br /&gt;
The template may be omitted if the instruction is intended only to create the input string. Templates are described in Chapter 7.&lt;br /&gt;
&lt;br /&gt;
The goal of the parsing operation is to associate a current and next position with each variable symbol in the template. The substring between these positions is then assigned as the value to the variable.&lt;br /&gt;
&lt;br /&gt;
The different options of the instruction are described below.&lt;br /&gt;
&lt;br /&gt;
* The optional UPPER keyword may be used with any of the input sources and specifies that the input string is to be translated to upper case before being parsed. It must be the first token following PARSE.&lt;br /&gt;
* The sources for the input strings are specified by the keyword symbols explained below. When multiple templates are supplied, each template receives a new input string, although for some source options the new string will be identical to the previous one. The input source string is copied before being parsed, so the original strings are never altered by the parsing process.&lt;br /&gt;
:* The ARG input option retrieves the argument strings supplied when the program was invoked. Command invocations normally have only a single argument string, but functions may have up to 15 argument strings.&lt;br /&gt;
:* The EXTERNAL input string is read from STDERR stream, (see Chapter 6) so as not to disturb any PUSHed or QUEUEd data. If multiple templates are supplied, each template will read a new string. This source option is the same as PULL.&lt;br /&gt;
:* The NUMERIC input option places the current numeric options in a string in the order DIGITS, FUZZ and FORM, separated by a single space.&lt;br /&gt;
:* The PULL input option reads a string from the input console. If multiple templates are supplied, each template will read a new string.&lt;br /&gt;
:* The SOURCE input option retrieves the &amp;quot;source&amp;quot; string for the program. This string is formatted as:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
{COMMAND | FUNCTION} {0 | 1} CALLED RESOLVED EXT HOST&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* {COMMAND | FUNCTION} indicates whether the program was invoked as a command or as a function.&lt;br /&gt;
:* {0 | 1} is a Boolean flag indicating whether a result string was requested by the caller.&lt;br /&gt;
:* CALLED is the name used to invoke this program.&lt;br /&gt;
:* RESOLVED is the final resolved name of the program.&lt;br /&gt;
:* EXT is the file extension to be used for searching (the default is &amp;quot;REXX&amp;quot;).&lt;br /&gt;
:* HOST is the initial host address for commands.&lt;br /&gt;
: The SOURCE option now returns the full path name of the ARexx program file. Formerly just a relative name was given, which was not sufficient to locate the program&#039;s source file.&lt;br /&gt;
: The &amp;quot;VALUE expression WITH&amp;quot; input string is the result of the supplied expression. The WITH keyword is required to separate the expression from the template. The expression result may be parsed repeatedly by using multiple templates, but the expression is not re-evaluated.&lt;br /&gt;
: The &amp;quot;VAR variable&amp;quot; input option uses the value of the specified variable as the input string. When multiple templates are provided, each template uses the current value of the variable. This value may change if the variable is included as an assignment target in any of the templates.&lt;br /&gt;
: The VERSION input option of the current configuration of the ARexx interpreter is supplied in the form:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARexx VERSION CPU MPU VIDEO FREQ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* VERSION is the release level of the interpreter, formatted as 1.14.&lt;br /&gt;
:* CPU indicates the processor currently running the program, and will be one of the values 68000, 68010, 68020, 68030 or 68040.&lt;br /&gt;
:* MPU will be either NONE, 68881, or 68882, depending on whether a math coprocessor is available.&lt;br /&gt;
:* VIDEO will indicate either NTSC or PAL.&lt;br /&gt;
:* FREQ gives the clock (line) frequency as either 60Hz or 50Hz.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Numeric string is: &amp;quot;9 0 SCIENTIFIC&amp;quot;*/&lt;br /&gt;
PARSE NUMERIC DIGITS FUZZ FORM .&lt;br /&gt;
SAY Digits /*9*/&lt;br /&gt;
SAY fuzz /*0*/&lt;br /&gt;
SAY form /*SCIENTIFIC*/&lt;br /&gt;
myvar = 1234567890&lt;br /&gt;
PARSE VAR myvar 1 a 3 b +2 c 1 d&lt;br /&gt;
SAY a&lt;br /&gt;
SAY b&lt;br /&gt;
SAY c&lt;br /&gt;
SAY d&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the output:&lt;br /&gt;
&lt;br /&gt;
 12&lt;br /&gt;
 34&lt;br /&gt;
 567890&lt;br /&gt;
 1234567890&lt;br /&gt;
&lt;br /&gt;
== PROCEDURE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PROCEDURE [EXPOSE variable [variable...]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PROCEDURE instruction is used within an internal function to create a new symbol table. This protects the symbols defined in the caller&#039;s environment from being altered by the execution of the function. PROCEDURE is usually the first statement within the function, although it is valid anywhere within the function body. It is an error to execute two PROCEDURE statements within the same function.&lt;br /&gt;
&lt;br /&gt;
The EXPOSE subkeyword provides a selective mechanism for accessing the caller&#039;s symbol table, and or passing global variables to a function. The variables following the EXPOSE keyword are taken to refer to symbols in the caller&#039;s table. Any subsequent changes made to these variables will be reflected in the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The variables in the EXPOSE list may include stem or compound symbols, in which case the ordering of the variables becomes significant. The EXPOSE list is processed from left to right and compound symbols are expanded based on the values in effect in the new generation. For example, suppose that the value of the symbol J in the previous generation is 123, and that J is uninitialized in the new generation. Then PROCEDURE EXPOSE J A.J will expose J and A.123, whereas PROCEDURE EXPOSE A.J J will expose A.J and J. Exposing a stem has the effect of exposing all possible compound symbols derived from that stem. That is, PROCEDURE EXPOSE A. exposes A.I, A.J, A.J.J, A.123, etc. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
fact: PROCEDURE /*A recursive function*/&lt;br /&gt;
   ARG i&lt;br /&gt;
   IF i = 1&lt;br /&gt;
   THEN RETURN 1&lt;br /&gt;
   ELSE RETURN i * fact (i-1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PULL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PULL [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pull is the shorthand form of the PARSE UPPER PULL instruction. It reads a string from the input console, translates it to upper case and parses it using the template. Multiple strings can be read by supplying additional templates. The instruction will read from the console even if no template is given. (Templates are described in Chapter 7.) For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PULL first last . /*Read names*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PUSH ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PUSH [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PUSH instruction is used to prepare a stream of data to be read by a command shell or other program. It appends a newline to the result of the expression then stacks or &amp;quot;pushes&amp;quot; it into the STDIN stream. Stacked lines are placed in the stream in &amp;quot;last-in, first-out&amp;quot; order and are available to be read just as though they had been entered interactively. For example, after issuing the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH line 1&lt;br /&gt;
PUSH line 2&lt;br /&gt;
PUSH line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the stream would be read in the order line 3, line 2, and line 1.&lt;br /&gt;
&lt;br /&gt;
PUSH allows the STDIN stream to be used as a private scratch pad to prepare data for subsequent processing. For example, several files could be concatenated with delimiters between them by simply reading the input files, PUSHing the line into the stream and inserting a delimiter where required. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   PUSH &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QUEUE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;QUEUE [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The QUEUE instruction is used to prepare a stream of data to be read by a command shell or other program. It is very similar to the PUSH instruction and differs only in that the data lines are placed in the STDIN stream in &amp;quot;first-in, first-out&amp;quot; order. In this case, the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
QUEUE line 1&lt;br /&gt;
QUEUE line 2&lt;br /&gt;
QUEUE line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would be read in the order line 1, line 2, and line 3. The QUEUEd lines always precede all interactively-entered lines and always follow any PUSHed (stacked) lines. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   QUEUE &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RETURN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RETURN [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RETURN is used to leave a function and return control to the point of the function&#039;s invocation. The evaluated expression is returned as the function result. If an expression is not supplied, an error may result in the caller&#039;s environment. Functions called from within an expression must return a result string and will generate an error if no result is available. Functions invoked by the CALL instruction need to return a result.&lt;br /&gt;
&lt;br /&gt;
A RETURN issued from the base environment of a program is not an error and is equivalent to an EXIT instruction. Refer to the EXIT instruction for a description of how result strings are passed back to an external caller. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
RETURN 6*7 /*Returns 42*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAY ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SAY [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result of the evaluated expressions is written to the output console, with a newline character appended. If the expression is omitted, a null string is sent to the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY &#039;The answer is &#039; value &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SELECT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SELECT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT begins a group of instructions containing one or more WHEN clauses and possibly a single OTHERWISE clause, each followed by a conditional statement. Only one of the conditional statements within the SELECT group will be executed. Each WHEN statement is executed in succession until one succeeds. If none succeeds, the OTHERWISE statement is executed. The SELECT range must be terminated by an END statement. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN SAY &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN SAY &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHELL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHELL [symbol | string | [[VALUE] [expression]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SHELL instruction is a synonym for the ADDRESS instruction. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SHELL edit /*Set host to &#039;EDIT&#039;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SIGNAL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGNAL {ON | OFF} condition SIGNAL [VALUE] expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SIGNAL {ON | OFF} controls the state of the internal interrupt flags. Interrupts allow a program to detect and retain control when certain errors occur. In this form SIGNAL must be followed by one of the keywords ON or OFF and one of the condition keywords listed below. The interrupt flag specified by the condition symbol is then set to the indicated state. The valid signal conditions are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;BREAK_C&#039;&#039;&#039; || A Ctrl+C break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_D&#039;&#039;&#039; || A Ctrl+D break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_E&#039;&#039;&#039; || A Ctrl+E break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_F&#039;&#039;&#039; || A Ctrl+F break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ERROR&#039;&#039;&#039; || A host command returned a non-zero code.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;HALT&#039;&#039;&#039; || An external HALT request was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOERR&#039;&#039;&#039; || An error was detected by the I/O system.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;NOVALUE&#039;&#039;&#039; || An uninitialized variable was used.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SYNTAX&#039;&#039;&#039; || A syntax or execution error was detected.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The condition keywords are interpreted as labels to which control will be transferred if the selected condition occurs. For example, if the ERROR interrupt is enabled and a command returns a non-zero code, ARexx will transfer control to the label ERROR:. The condition label must be defined in the program; otherwise, an immediate SYNTAX error results and the program exits.&lt;br /&gt;
&lt;br /&gt;
In SIGNAL [VALUE] expression, the tokens following SIGNAL are evaluated as an expression. An immediate interrupt is generated that transfers control to the label specified by the expression result. The instruction thus acts as a &amp;quot;computed goto&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Whenever an interrupt occurs, all currently active control ranges (IF, DO, SELECT, INTERPRET, or interactive TRACE) are dismantled before the transfer of control. Thus, the transfer cannot be used to jump into the range of a DO loop or other control structure. Only the control structures in the current environment are affected by a SIGNAL condition, making it safe to SIGNAL from within an internal function without affecting the state of the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The special variable SIGL is set to the current line number whenever a transfer of control occurs. The program can inspect SIGL to determine which line was being executed before the transfer. If an ERROR or SYNTAX condition causes an interrupt, the special variable RC is set to the error code that triggered the interrupt. For the ERROR condition, this code is usually an error severity level. Refer to Appendix A for further details on error codes and severity levels. The SYNTAX condition will always indicate an ARexx error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SIGNAL on error /*Enable interrupt*/&lt;br /&gt;
SIGNAL off syntax /*Disable SYNTAX*/&lt;br /&gt;
SIGNAL start /*Goto START*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WHEN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WHEN expression [THEN [;] [conditional statement]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The WHEN instruction is similar to the IF instruction, but is valid only within a SELECT range. Each WHEN expression is evaluated in turn and must result in a Boolean value. If the result is a 1, the conditional statement is executed and control passes to the END statement that terminates the SELECT. As with the IF instruction, the THEN need not be part of the same clause. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i&amp;lt;j THEN SAY &#039;less&#039;&lt;br /&gt;
   WHEN i=j THEN SAY &#039;equal&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;greater&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Elements_of_ARexx&amp;diff=6887</id>
		<title>AmigaOS Manual: ARexx Elements of ARexx</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Elements_of_ARexx&amp;diff=6887"/>
		<updated>2014-01-27T22:34:31Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter introduces the rules and concepts that make up the ARexx programming language and explains how ARexx interprets the characters and words used in programs. The different elements that are explained include:&lt;br /&gt;
&lt;br /&gt;
* Tokens - the smallest element of the ARexx language&lt;br /&gt;
* Clauses - the smallest executable unit, similar to a sentence&lt;br /&gt;
* Expressions - a group of evaluated tokens&lt;br /&gt;
* The Command Interface - the process by which ARexx programs communicate with ARexx-compatible applications&lt;br /&gt;
&lt;br /&gt;
This chapter also includes a discussion of the ARexx execution environment. This is intended for more advanced Amiga users and includes technical details on interprocess communication.&lt;br /&gt;
&lt;br /&gt;
= Tokens =&lt;br /&gt;
&lt;br /&gt;
Tokens, the smallest distinct entities of the ARexx language, may be a single character or a series of characters. There are five categories of tokens:&lt;br /&gt;
&lt;br /&gt;
* comments&lt;br /&gt;
* symbols&lt;br /&gt;
* strings&lt;br /&gt;
* operators&lt;br /&gt;
* special characters&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
A comment is any group of characters beginning with the sequence /* (slash asterisk) and ending with */ (asterisk slash). Each ARexx program must begin with a comment. Each /* must have a matching */ . For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This is an ARexx comment*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comments may be placed anywhere in a program and can even be nested within one another. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A /*nested*/ comment*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert comments throughout your program. Comments remind you and others of the program&#039;s intentions. Because the interpreter ignores comments when it scans your programs, comments do not slow down the execution of your program.&lt;br /&gt;
&lt;br /&gt;
== Symbols ==&lt;br /&gt;
&lt;br /&gt;
A symbol is any group of the characters a-z, A-Z, 0-9, and period (.), exclamation point (!), question mark (?), dollar sign ($), and underscore (_). Symbols are translated to uppercase as the interpreter scans the program, so the symbol MyName is equivalent to MYNAME. The four types of recognized symbols are:&lt;br /&gt;
&lt;br /&gt;
; Fixed symbols&lt;br /&gt;
: A series of numeric characters that begins with a digit (0-9) or a period (.). The value of a fixed symbol is always the symbol name itself, translated to uppercase. 12345 is an example of a fixed symbol.&lt;br /&gt;
&lt;br /&gt;
; Simple symbols&lt;br /&gt;
: A series of alphabetic characters that begins with a letter A-Z. &amp;quot;MyName&amp;quot; is an example of a simple symbol.&lt;br /&gt;
&lt;br /&gt;
; Stem symbols&lt;br /&gt;
: A series of alphanumeric characters that ends with one period. &amp;quot;A.&amp;quot; and &amp;quot;Stem9.&amp;quot; Are examples of stem symbols.&lt;br /&gt;
&lt;br /&gt;
; Compound symbols&lt;br /&gt;
: A series of alphanumeric characters that includes one or more periods within the characters. &amp;quot;A.1.Index&amp;quot; is an example of a compound symbol.&lt;br /&gt;
&lt;br /&gt;
Simple, stem, and compound symbols are called variables and may be assigned a value during the course of the program execution. If a variable has not yet been assigned a value, it is uninitialized. The value for an uninitialized variable is the variable name itself (translated to uppercase, if applicable).&lt;br /&gt;
&lt;br /&gt;
Stems and compound symbols have special properties that make them useful for building arrays and lists. Stem symbols provide a way to initialize a whole class of compound symbols. A compound symbol can be regarded as having the structure stem.n1.n2...nk, where the leading name is a stem symbol and each node, n1...nk, is a fixed or simple symbol.&lt;br /&gt;
&lt;br /&gt;
When an assignment is made to a stem symbol, it assigns that value to all possible compound symbols derived from the stem. Thus, the value of a compound symbol depends on the prior assignments made to itself or its associated stem.&lt;br /&gt;
&lt;br /&gt;
Whenever a compound symbol appears in a program, its name is expanded by replacing each node with its current value. The value string may consist of any characters, including embedded blanks, and will not be converted to uppercase. The result of the expansion is a new name that is used in place of the compound symbol. For example, if J has the value 3 and K has the value 7, then the compound symbol A.J.K will expand to A.3.7.&lt;br /&gt;
&lt;br /&gt;
Compound symbols can be regarded as a form of associative or content-addressable memory. For example, suppose that you needed to store and retrieve a set of names and telephone numbers. The conventional approach would be to set up two arrays, NAME and NUMBER, each indexed by an integer running from one to the number of entries. A number would be looked up by scanning the name array until the given name was found, say in NAME.12, and then retrieving NUMBER.12. With compound symbols, the symbol NAME could hold the name to be retrieved, and NUMBER.NAME would then expand to the corresponding number, for example, NUMBER.CBM.&lt;br /&gt;
&lt;br /&gt;
Compound symbols can also be used as conventional indexed arrays, with the added convenience that only a single assignment (to the stem) is required to initialize the entire array.&lt;br /&gt;
&lt;br /&gt;
For instance, the program below uses the stems &amp;quot;number.&amp;quot; and &amp;quot;addr.&amp;quot; to create a computerized telephone directory.&lt;br /&gt;
&lt;br /&gt;
=== Program 8. Phone.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A telephone book to show compound variables.*/&lt;br /&gt;
IF ARG () ~ = 1 THEN DO&lt;br /&gt;
SAY &amp;quot;USAGE: rx phone name&amp;quot;&lt;br /&gt;
EXIT 5&lt;br /&gt;
END&lt;br /&gt;
/*Open window to display phone nos/addresses.*/&lt;br /&gt;
CALL OPEN out, &amp;quot;con:0/0/640/60/ARexx Phonebook&amp;quot;&lt;br /&gt;
IF ~ result THEN DO&lt;br /&gt;
SAY &amp;quot;Open failure ... sorry&amp;quot;&lt;br /&gt;
EXIT 10&lt;br /&gt;
END&lt;br /&gt;
/*Number definitions*/&lt;br /&gt;
number. = &#039;(not found)&#039;&lt;br /&gt;
number.wsh = &#039;(555) 001-0001&#039;&lt;br /&gt;
addr. = &#039;(not found)&#039;&lt;br /&gt;
number.CBM = &#039;(555) 002-0002&#039;&lt;br /&gt;
addr.CBM = &#039;1200 Wilson Dr., West Chester, PA, 19380&#039;&lt;br /&gt;
/*(Work is done here)*/&lt;br /&gt;
ARG name /*The name*/&lt;br /&gt;
CALLWRITELN out, name | | &amp;quot; &#039;s number is&amp;quot; number.name&lt;br /&gt;
CALL WRITELN out,name | | &amp;quot; &#039;s address is&amp;quot; addr.name&lt;br /&gt;
CALL WRITELN out, &amp;quot;Press Return to exit.&amp;quot;&lt;br /&gt;
CALL READLN out&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute the program, activate a Shell window and enter:&lt;br /&gt;
&lt;br /&gt;
 RX Phone cbm&lt;br /&gt;
&lt;br /&gt;
A window will display the name and address assigned to CBM.&lt;br /&gt;
&lt;br /&gt;
== Strings ==&lt;br /&gt;
&lt;br /&gt;
A string is any group of characters beginning and ending with a quote (&#039;) or double quote (&amp;quot;) delimiter. The same delimiter must be used at both ends of the string. To include the delimiter character in the string, use a double-delimiter sequence (&#039;&#039; or &amp;quot;&amp;quot;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Now is the time.&amp;quot; An example of a normal string.&lt;br /&gt;
&lt;br /&gt;
&#039;Can&#039;&#039;t you see?&#039; An example of a string using a double-delimiter sequence.&lt;br /&gt;
&lt;br /&gt;
The value of a string is the string itself. The number of characters in the string is called its length. If the string does not contain any characters, it is called a null string.&lt;br /&gt;
&lt;br /&gt;
Strings that are followed by an X or B character are classified as hex or binary strings, respectively, and must be composed of hexadecimal digits (0-9, A-F) or binary digits (0,1). For example:&lt;br /&gt;
&lt;br /&gt;
 &#039;4A 3B C0&#039;X&lt;br /&gt;
 &#039;00110111&#039;B&lt;br /&gt;
&lt;br /&gt;
Blanks are permitted at byte boundaries to improve readability. Hex and binary strings are convenient for specifying non-ASCII characters and machine-specific information, like addresses. They are converted immediately to the packed (machine-compressed) internal form.&lt;br /&gt;
&lt;br /&gt;
== Operators ==&lt;br /&gt;
&lt;br /&gt;
Operators are a combination of the following characters: ~ + - * / = &amp;gt; &amp;lt; &amp;amp; | ^, as explained in this section. There are four types of operators:&lt;br /&gt;
&lt;br /&gt;
* Arithmetic operators require one or two numeric operands and produce a numeric result.&lt;br /&gt;
* Concatenation operators join two strings into a single string.&lt;br /&gt;
* Comparison operators require two operands and produce a Boolean (0 or 1) result.&lt;br /&gt;
* Logical operators require one or two Boolean operands and produce a Boolean result.&lt;br /&gt;
&lt;br /&gt;
Each operator has an associated priority that determines the order in which operations will be performed in an expression. Operators with higher priorities (8) are performed before those with lower priorities (1).&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
An important class of operands is that representing numbers. Numbers consist of the characters 0-9, a period (.), plus sign (+), minus sign (-), and blanks. To indicate exponential notation, a number may be followed by an &amp;quot;e&amp;quot; or &amp;quot;E&amp;quot; and a (signed) integer.&lt;br /&gt;
&lt;br /&gt;
Both strings and symbols may be used to specify numbers. Since the language is typeless, variables do not have to be declared as numeric before use in an arithmetic operation. Instead, each value string is examined when it is used in order to verify that it represents a number. The following examples are all valid numbers:&lt;br /&gt;
&lt;br /&gt;
 33&lt;br /&gt;
 &amp;quot; 12.3 &amp;quot;&lt;br /&gt;
 0.321e12&lt;br /&gt;
 &#039; + 15. &#039;&lt;br /&gt;
&lt;br /&gt;
Leading and trailing blanks are permitted. Blanks may be embedded between a plus (+) or minus (-) sign and the number, but not within the number itself.&lt;br /&gt;
&lt;br /&gt;
You can modify the basic precision used for arithmetic calculations while a program is executing. The number of significant figures used in arithmetic operations is determined by the Numeric Digits setting and may be modified using the NUMERIC instruction described in Chapter 4.&lt;br /&gt;
&lt;br /&gt;
The number of decimal places used for a result depends on the operation and the number of decimal places in the operands. ARexx preserves trailing zeroes to indicate the precision of the result. If the total number of digits required to express a value exceeds the current Numeric Digits setting, the number is formatted in exponential notation. They are:&lt;br /&gt;
&lt;br /&gt;
* Scientific notation - the exponent is adjusted so that a single digit is placed to the left of the decimal point.&lt;br /&gt;
* Engineering notation - the number is scaled so that the exponent is a multiple of 3 and the digits to the left of the decimal point range from 1 to 999.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-1. Arithmetic Operators&lt;br /&gt;
! Operator !! Priority !! Example !! Result&lt;br /&gt;
|-&lt;br /&gt;
| + (prefix conversion) || 8 || &#039;3.12&#039; || 3.12&lt;br /&gt;
|-&lt;br /&gt;
| - (prefix negation) || 8 || -&amp;quot;3.12&amp;quot; || -3.12&lt;br /&gt;
|-&lt;br /&gt;
| ** (exponentiation) || 7 || 0.5**3 || 0.125&lt;br /&gt;
|-&lt;br /&gt;
| * (multiplication) || 6 || 1.5*1.50 || 2.250&lt;br /&gt;
|-&lt;br /&gt;
| / (division) || 6 || 6 / 3 || 2&lt;br /&gt;
|-&lt;br /&gt;
| % (integer division) || 6 || -8 % 3 || -2&lt;br /&gt;
|-&lt;br /&gt;
| // (remainder) || 6 || 5.1//0.2 || 7.15&lt;br /&gt;
|-&lt;br /&gt;
| + (addition) || 5 || 3.1+4.05 || 7.15&lt;br /&gt;
|-&lt;br /&gt;
| - (subtraction) || 5 || 5.55 - 1 || 4.55 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Concatenation Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx defines two concatenation operators. The first, identified by the operator sequence || (two vertical bars), joins two strings into a single string with no intervening blank. This type of concatenation can also be specified implicitly. When a symbol and a string are typed without any intervening spaces, ARexx behaves as if the || operator had been specified. The second concatenation operation is identified by the blank operator and joins the two operand strings with one intervening blank.&lt;br /&gt;
&lt;br /&gt;
The priority of all concatenation operations is 4. Table 3-2 summarizes the different operations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-2. Concatenation Operators&lt;br /&gt;
! Operator !! Operation !! Example !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; || Concatenation || &#039;why me, &#039;&amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt;&#039;Mom?&#039; || why me, Mom?&lt;br /&gt;
|-&lt;br /&gt;
| Blank || Blank Concatenation || &#039;good&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;times&#039; || good times&lt;br /&gt;
|-&lt;br /&gt;
| none || Implied Concatenation || one&#039;two&#039;three || ONEtwoTHREE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx supports three types of comparisons:&lt;br /&gt;
&lt;br /&gt;
* Exact comparisons - character-by-character comparison.&lt;br /&gt;
* String comparisons - ignore leading blanks and add blanks to the shorter string.&lt;br /&gt;
* Numeric comparisons - convert the operands to an internal numeric form using the current Numeric Digits setting and then run an arithmetic comparison.&lt;br /&gt;
&lt;br /&gt;
Comparisons always result in a Boolean value. The numbers 0 and 1 are used to represent the Boolean values false and true. The use of a value other than 0 or 1 when a Boolean operand is expected will generate an error. Any number equivalent to 0 or 1, for example 0.000 or 0.1E1, is also acceptable as a Boolean value.&lt;br /&gt;
&lt;br /&gt;
Except for the exact equality (==) and exact inequality (~==) operators, all comparison operators dynamically determine whether a string or numeric comparison is to be performed. A numeric comparison is performed if both operands are valid numbers. Otherwise, the operands are compared as strings.&lt;br /&gt;
&lt;br /&gt;
All comparisons have a priority of 3. Table 3-3 lists the acceptable comparison operators.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-3. Comparison Operators&lt;br /&gt;
! Operator !! Operation !! Mode&lt;br /&gt;
|-&lt;br /&gt;
| == || Exact Equality || Exact&lt;br /&gt;
|-&lt;br /&gt;
| ~== || Exact Inequality || Exact&lt;br /&gt;
|-&lt;br /&gt;
| = || Equality || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| ~= || Inequality || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Greater Than || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= or ~&amp;lt; || Greater Than or Equal To || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; || Less Than || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= or ~&amp;gt; || Less Than or Equal To || String/Numeric&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical (Boolean) Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx defines the four logical operations, NOT, AND, OR, and Exclusive OR, all of which require Boolean operands and produce a Boolean result. An attempt to perform a logical operation on a non-Boolean operand will generate an error. Table 3-4 shows the acceptable logical operators.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-4. Logical Operators&lt;br /&gt;
! Operator !! Priority !! Operation&lt;br /&gt;
|-&lt;br /&gt;
| ~ || 8 || NOT (Inversion)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp; || 2 || AND&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; || 1 || OR&lt;br /&gt;
|-&lt;br /&gt;
| ^or &amp;amp;&amp;amp; || 1 || Exclusive OR&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special Characters ==&lt;br /&gt;
&lt;br /&gt;
A few punctuation characters have special meanings within ARexx, as shown in Table 3-5.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-5. Special Characters&lt;br /&gt;
! Special Character !! Definition &lt;br /&gt;
|-&lt;br /&gt;
| (:) Colon&lt;br /&gt;
| A colon defines a label when preceded by a symbol token (any alphanumeric character or . ! ? $).&lt;br /&gt;
|-&lt;br /&gt;
| ( ) Parentheses&lt;br /&gt;
| Parentheses are used to group operators and operands into subexpressions to override the normal operator priorities. An open parenthesis also serves to identify a function call within an expression. A Symbol or string followed immediately by an open parenthesis defines a function name. Parentheses must always be matched within a statement.&lt;br /&gt;
|-&lt;br /&gt;
| (;) Semicolon&lt;br /&gt;
| A semicolon acts as a statement terminator. Several statements that fit on one line may be separated by semicolons.&lt;br /&gt;
|-&lt;br /&gt;
| (,) Comma&lt;br /&gt;
| A comma acts as the continuation character for statements broken into several lines and as a separator of argument expressions in a function call.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Clauses =&lt;br /&gt;
&lt;br /&gt;
Clauses, the smallest language unit that can be executed as a statement, are formed from token groupings.&lt;br /&gt;
&lt;br /&gt;
As the program is read, the language interpreter splits the program into groups of clauses. These groups of one or more clauses are then broken down into tokens and each clause is classified as a particular type. Seemingly small syntactic differences may completely change the semantic content of a statement. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY &#039;Hello, Bill&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an instruction clause and will display &amp;quot;Hello, Bill&amp;quot; on the console, but:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;SAY &#039;Hello, Bill&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is a command clause, and will issue &amp;quot;SAY Hello, Bill&amp;quot; as a command to an external program. The presence of the leading null string (&#039;&#039;) changes the classification from an instruction clause to a command clause.&lt;br /&gt;
&lt;br /&gt;
The end of a line normally acts as the implicit end of a clause. A clause can be continued on the next line by ending the line with a comma. The comma is ignored by the program, and the next line is considered as a continuation of the clause. There is no limit to the number of continuations that may occur (except for those limits imposed by the command buffer).&lt;br /&gt;
&lt;br /&gt;
String and comment tokens are automatically continued if a line ends before the closing delimiter has been found, and the newline (i.e., Enter) character is not considered to be part of the token.&lt;br /&gt;
&lt;br /&gt;
== Null Clauses ==&lt;br /&gt;
&lt;br /&gt;
Null clauses are lines of blanks or comments and may appear anywhere in a program. They have no function in the execution of a program, except to aid its readability and to increment the line count.&lt;br /&gt;
&lt;br /&gt;
== Label Clauses ==&lt;br /&gt;
&lt;br /&gt;
A label clause is a symbol followed by a colon (:). A label acts as a place marker in the program, but no action occurs with the execution of a label. The colon is considered as an implicit clause terminator, so each label stands as a separate clause. Label clauses may appear anywhere in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
start: /*Begin execution*/&lt;br /&gt;
syntax: /*Error processing*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assignment Clauses ==&lt;br /&gt;
&lt;br /&gt;
Assignment clauses are identified by a variable symbol followed by an = operator. (In this context the = operator&#039;s normal definition of equality comparison is overridden.) The tokens to the right of the = are evaluated as an expression and the result is assigned to the variable. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
When = &#039;Now is the time&#039;&lt;br /&gt;
answ = 3.14 * fact(5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equal sign (=) assigns the value &#039;Now is the time&#039; to the variable &#039;when&#039;, and assigns the result of 3.14 * fact(5) to the variable &#039;answ&#039;.&lt;br /&gt;
&lt;br /&gt;
== Instruction Clauses ==&lt;br /&gt;
&lt;br /&gt;
Instruction clauses begin with the name of the instruction and tell ARexx to perform an action. Instruction names are described in Chapter 4. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DROP a b c&lt;br /&gt;
SAY &#039;please&#039;&lt;br /&gt;
IF j &amp;gt; 5 THEN LEAVE; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command Clauses ==&lt;br /&gt;
&lt;br /&gt;
Command clauses are any ARexx expression that cannot be classified as one of the preceding types of clauses. The expression is evaluated and the result is issued as a command to an external host. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;delete&#039; &#039;myfile&#039; /*AmigaDOS command*/&lt;br /&gt;
&#039;jump&#039; current+10 /*An editor command*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The delete command is not recognized as an ARexx command, so it is sent to the external host, in this case AmigaDOS. The jump command in the second example is assumed to be understood by an external text editor.&lt;br /&gt;
&lt;br /&gt;
= Expressions =&lt;br /&gt;
&lt;br /&gt;
Expressions are a group of evaluated tokens. Most statements contain at least one expression. Expressions are composed of:&lt;br /&gt;
&lt;br /&gt;
* Strings - The value of a string is the string itself.&lt;br /&gt;
* Symbols - The value of a fixed symbol is the symbol itself, translated to uppercase. Symbols may be used as variables and may have an assigned value.&lt;br /&gt;
* Operators - An operator has a priority order that determines when it will be performed.&lt;br /&gt;
* Parentheses - Parentheses may be used to alter the normal order of evaluation in the expression or to identify function calls. A symbol or string followed immediately by an open parenthesis defines the function name, and the tokens between the opening and closing parenthesis form the argument list for the function. For example, the expression:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
J &#039;factorial is&#039; fact (J)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is composed of:&lt;br /&gt;
&lt;br /&gt;
* a symbol - J&lt;br /&gt;
* a blank operator&lt;br /&gt;
* a string - factorial is&lt;br /&gt;
* another blank&lt;br /&gt;
* a symbol - fact&lt;br /&gt;
* an open parenthesis&lt;br /&gt;
* a symbol - J&lt;br /&gt;
* a closing parenthesis&lt;br /&gt;
&lt;br /&gt;
In this example, FACT is a function name and (J) is its argument list, the single expression J.&lt;br /&gt;
&lt;br /&gt;
Before the evaluation of an expression proceeds, ARexx must obtain a value for each symbol in the expression. For fixed symbols the value is the symbol name itself, but variable symbols must be looked up in the current symbol table. In the example above, if the symbol J was assigned the value 3, the expression after symbol resolution would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
3 &#039;factorial is&#039; FACT (3)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To avoid ambiguities in the values assigned to symbols during the resolution process, ARexx guarantees a strict left-to-right resolution order. Symbol resolution proceeds irrespective of operator priority or parenthetical grouping. If a function call is found, the resolution is suspended while the function is evaluated. It is possible for the same symbol to have more than one value in an expression.&lt;br /&gt;
&lt;br /&gt;
If the previous example was rearranged to read:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FACT(J) &#039;is&#039; J &#039;factorial&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would the second occurrence of symbol J still resolve to 3? In general, function calls may have side effects that include altering the values of variables. If the example was rearranged, the value of J might have been changed by the call to FACT.&lt;br /&gt;
&lt;br /&gt;
After all symbol values have been resolved, the expression is evaluated based on operator priority and subexpression grouping. ARexx does not guarantee an order of evaluation among operators of equal priority and does not employ a &amp;quot;fast path&amp;quot; evaluation of Boolean operations. For example, in the expression:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
(1 = 2) &amp;amp; (FACT(3) = 6)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the call to the FACT function will be made even though the first term of the AND (&amp;amp;) operation is 0. This example points out that ARexx will continue reading left to right, even though the given example is false and will return a value of 0.&lt;br /&gt;
&lt;br /&gt;
= The Command Interface =&lt;br /&gt;
&lt;br /&gt;
The ARexx command interface is a public message port. ARexx compatible applications must have this message port. ARexx programs issue commands by placing the command string in a message packet and sending the packet to the host&#039;s message port. The program suspends operation while the host processes the commands and resumes when the message packet returns.&lt;br /&gt;
&lt;br /&gt;
== The Host Address ==&lt;br /&gt;
&lt;br /&gt;
ARexx maintains two implicit host addresses, a current and a previous value, as part of the program&#039;s storage environment. These values can be changed at any time using the ADDRESS instruction (or its synonym, SHELL). The current host address can be inspected with the ADDRESS() built-in function. The default host address string is REXX, but this can be overridden when a program is invoked. Most host applications will supply the name of their public port when they invoke a macro program, so that the macro can automatically issue commands back to the host.&lt;br /&gt;
&lt;br /&gt;
One special host address is recognized. The string COMMAND indicates that the macro should be issued directly to AmigaDOS. All other host addresses are assumed to refer to a public message port. An attempts to send a command to a nonexistent message port will generate the syntax error &amp;quot;Host environment not found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Program 9 shows the interaction between ARexx and the AmigaDOS editor, ED. The program sees if ED is running, determines the name of the message port, and sets up some stem variables.&lt;br /&gt;
&lt;br /&gt;
=== Program 9. ED-status.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Prints status of ED. ED must be running before this program is started. ED ports are named &#039;Ed&#039;, &#039;Ed_1&#039;, &#039;Ed_2&#039;, and so on.*/&lt;br /&gt;
DEFAULT_ED = &amp;quot;Ed &amp;quot;/*This name is case sensitive*/&lt;br /&gt;
/*Procedure to follow if ED isn&#039;t running, or if only a second (or later) instance of ED is running.*/&lt;br /&gt;
DO WHILE ~ SHOW (&#039;p&#039;,DEFAULT_ED) /*Look for port*/&lt;br /&gt;
SAY &amp;quot;Cannot find port named&amp;quot; DEFAULT_ED&lt;br /&gt;
SAY &amp;quot;Available ports:&amp;quot;&lt;br /&gt;
SAY SHOW (&#039;P&#039;) &#039;0a&#039;X&lt;br /&gt;
SAY &amp;quot;Enter different name for port, or QUIT to quit &amp;quot;/*Let user choose port if we can&#039;t find it*/&lt;br /&gt;
DEFAULT_ED = READLN(stdout)IF STRIP(UPPER(DEFAULT_ED)) = &#039;QUIT&#039; then exit 10 /*Let user quit*/&lt;br /&gt;
END&lt;br /&gt;
SAY &amp;quot;Using ED port&amp;quot; DEFAULT_ED&lt;br /&gt;
/*Now that port is found, have ARexx address it.*/&lt;br /&gt;
ADDRESS VALUE DEFAULT_ED&lt;br /&gt;
/* Set up some useful stem variables*/&lt;br /&gt;
STEM.0 = 15 /*Number of ED ARexx variables*/&lt;br /&gt;
STEM.1 = &#039;LEFT&#039; /*Left margin (SL)*/&lt;br /&gt;
STEM.2 = &#039;RIGHT&#039; /*Right margin (SR)*/&lt;br /&gt;
STEM.3 = &#039;TABSTOP&#039; /*Tab stop setting (ST)*/&lt;br /&gt;
STEM.4 = &#039;LMAX&#039; /*Max visible line on screen*/&lt;br /&gt;
STEM.5 = &#039;WIDTH&#039; /*Width of screen in chars*/&lt;br /&gt;
STEM.6 = &#039;X&#039; /*Physical X pos. on screen-from 1*/&lt;br /&gt;
STEM.7 = &#039;Y&#039; /*Physical Y pos. on screen-from 1*/&lt;br /&gt;
STEM.8 = &#039;BASE&#039; /*Window base*/&lt;br /&gt;
/*Base is 0 unless screen is shifted right)*/&lt;br /&gt;
STEM.9 = &#039;EXTEND&#039; /*Extended margin value (EX)*/&lt;br /&gt;
STEM.10 = &#039;FORCECASE&#039; /*Case sensitivity flag*/&lt;br /&gt;
STEM.11 = &#039;LINE&#039; /*Current line number*/&lt;br /&gt;
STEM.12 = &#039;FILENAME&#039; /*File being edited*/&lt;br /&gt;
STEM.13 = &#039;CURRENT&#039; /*Text of current line*/&lt;br /&gt;
STEM.14 = &#039;LASTCMD&#039; /*Last extended command*/&lt;br /&gt;
STEM.15 = &#039;SEARCH&#039; /*Last search string*/&lt;br /&gt;
/*Ask ED to put values into stem variable &#039;STEM.&#039;*/&lt;br /&gt;
&#039;RV&#039; &#039;/STEM/&#039; /*RV is an ED command used to send into from ED to ARexx*/&lt;br /&gt;
/*STEM.1 is LEFT, and STEM.LEFT now holds a value from ED. Here is a way to print that information.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to STEM.0&lt;br /&gt;
   ED_VAR = STEM.1&lt;br /&gt;
   SAY STEM.1 &amp;quot;=&amp;quot; STEM.ED_VAR /*Print ED variable/value*/&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating a Macro ==&lt;br /&gt;
&lt;br /&gt;
ARexx can be used to write programs for any host application that includes a compatible command interface. Some application programs are designed with an embedded macro language and may include many pre-defined macro commands.&lt;br /&gt;
&lt;br /&gt;
Check your macro program for &amp;quot;shortcut&amp;quot; commands. Some programs may include powerful functions that were implemented specifically for use in macro programs.&lt;br /&gt;
&lt;br /&gt;
The interpretation of the received commands depends entirely on the host application. In the simplest case, the command strings will correspond exactly to commands that could be entered directly by a user. For example, positional control (up/down) commands for a text editor would probably have identical interpretations. Other commands may be valid only when issued from a macro program. A command to simulate a menu operation would probably not be entered by the user. In Program 10, the ARexx program is called by ED to transpose two characters.&lt;br /&gt;
&lt;br /&gt;
=== Program 10. Transpose.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Given string &#039;123&#039;, if cursor is on 3, macro converts string to &#039;213&#039;.*/&lt;br /&gt;
HOST = ADDRESS() /*Find out which ED called us*/&lt;br /&gt;
ADDRESS VALUE HOST /*. . . and talk to it.*/&lt;br /&gt;
&#039;rv&#039; &#039;/CURR/&#039; /*Have ED put info in stem CURR*/&lt;br /&gt;
/*We&#039;ll need two pieces of informations:*/&lt;br /&gt;
currpos = CURR.X /*Position of cursor on line*/&lt;br /&gt;
currling = CURR.CURRENT /*Contents of current line*/&lt;br /&gt;
IF (currpos &amp;gt;2) /*Must work on current line*/&lt;br /&gt;
THEN currpos = currpos - 1&lt;br /&gt;
ELSE DO /*Report error and exit*/&lt;br /&gt;
&#039;sm /Cursor must be at pos. 2 or more to the right/&#039;&lt;br /&gt;
EXIT 10&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Need to reverse the CURRPOSth and CURRPOSth-1 chars and replace the current line with the new one.*/&lt;br /&gt;
DROP CURR. /*STEM variable CURR is no longer needed; save some memory*/&lt;br /&gt;
&#039;d&#039; /*Tell ED to delete current line*/&lt;br /&gt;
currlin = swapch (currpos,currlin) /*Swap 2 chars*/&lt;br /&gt;
&#039;i /&#039;| |currlin| |&#039;/ /*Insert modified line*/&lt;br /&gt;
DO i = 1 to currpos /*Place cursor back at start*/&lt;br /&gt;
&#039;cr&#039; /*ED&#039;s &#039;cursor right&#039; command*/&lt;br /&gt;
END&lt;br /&gt;
EXIT /*All done*/&lt;br /&gt;
/*Function to swap two characters*/&lt;br /&gt;
swapch: procedure&lt;br /&gt;
PARSE ARG cpos,clin&lt;br /&gt;
chl = substr (clin, cpos, 1) /*Get character*/&lt;br /&gt;
clin = delstr (clin, cpos, 1) /*Delete it from string*/&lt;br /&gt;
clin = insert (chl,clin,cpos-2,1) /*Insert to create transposition*/&lt;br /&gt;
RETURN clin /*Return modified string*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute this example from ED, press ESC then enter:&lt;br /&gt;
&lt;br /&gt;
 RX &amp;quot;transpose.rexx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can also assign this string to a function key.&lt;br /&gt;
&lt;br /&gt;
== Return Codes ==&lt;br /&gt;
&lt;br /&gt;
After it finishes processing a command, the host replies with a return code to indicate the status of the command. The documentation for the host application should describe the possible return codes for each command. These codes can be used to determine whether the operation performed by the command was successful.&lt;br /&gt;
&lt;br /&gt;
This return code is placed in the ARexx special variable RC so that it can be examined by the macro. A value of zero means that the command was successful. A return of a positive integer indicates an error condition. The higher the integer, the more severe the error. The return code allows the macro program to determine whether the command succeeded and to take action if it failed.&lt;br /&gt;
&lt;br /&gt;
== Command Shells ==&lt;br /&gt;
&lt;br /&gt;
Although ARexx was designed to work most effectively with programs that support its specific command interface, it can be used with any command shell program that uses standard I/O mechanisms to obtain its input stream. One way to use ARexx is to create an actual command file on the Ram Disk, then pass it directly to the Shell. Program 11 opens a new Shell to run a standard EXECUTE script.&lt;br /&gt;
&lt;br /&gt;
=== Program 11. Shell.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Launch a new Shell*/&lt;br /&gt;
ADDRESS command&lt;br /&gt;
conwindow = &amp;quot;CON:0/0/640/100/NewOne/Close&amp;quot;&lt;br /&gt;
/*Create a command file*/&lt;br /&gt;
CALL OPEN out, &amp;quot;ram:temp&amp;quot;,write&lt;br /&gt;
CALL WRITELN out, &#039;echo &amp;quot;This is a test&amp;quot;&#039;&lt;br /&gt;
CALL CLOSE out&lt;br /&gt;
/*Open the new Shell window*/&lt;br /&gt;
&#039;newshell&#039; conwindow &amp;quot;ram:temp&amp;quot;&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= The Execution Environment =&lt;br /&gt;
&lt;br /&gt;
{{Note|The material in this section is intended for advanced Amiga users. This information assumes a working knowledge of the Amiga operating system and a familiarity with the reference material on this wiki.}}&lt;br /&gt;
&lt;br /&gt;
The ARexx interpreter, RexxMast, provides a uniform execution environment by running each program as a separate process in the Amiga&#039;s multitasking operating system. This allows for a flexible interface between an external host program and RexxMast. The host program can proceed concurrently with its operations or can wait for the interpreted ARexx program to finish. Each ARexx program has both an external and internal environment.&lt;br /&gt;
&lt;br /&gt;
== The External Environment ==&lt;br /&gt;
&lt;br /&gt;
The external environment includes its process structure, input and output streams, and current directory. When each ARexx process is created, it inherits the input and output streams and current directory from its client, the external program that invoked the ARexx program. For example, if an ARexx program was started from a Shell, the ARexx program will inherit the input and output stream and current directory of that Shell. The current directory is used as the starting point in any search for a program or data file. External functions are limited to a maximum of 15 arguments.&lt;br /&gt;
&lt;br /&gt;
== The Internal Environment ==&lt;br /&gt;
&lt;br /&gt;
The internal environment of an ARexx program consists of a static global structure and one or more storage environments. The global data values are fixed (static) at the time the program is invoked. These values include the program source code, static data strings, and argument strings. Once the program is running, these values cannot be changed.&lt;br /&gt;
&lt;br /&gt;
ARexx programs invoked as commands usually have only one argument string, although the command tokenization option may provide more than one. A program invoked as an internal function can have any number of arguments. These arguments persist for the duration of the program.&lt;br /&gt;
&lt;br /&gt;
The storage environment includes the symbol table used for variable values, numeric options, trace options, and host address strings. While the global environment is unique, there may be many storage environments during the course of the program execution. Each time an internal function is called, a new storage environment is activated and initialized. The initial values for most fields are inherited from the previous environment, but values may be changed afterwards without affecting the caller&#039;s environment. The new environment persists until control returns from the function.&lt;br /&gt;
&lt;br /&gt;
Every storage environment includes a symbol table to store the value strings that have been assigned to variables. This symbol table is organized as a two-level binary tree. The primary level stores entries for simple and stem symbols. The secondary level is used for compound symbols. All of the compound symbols associated with a particular stem are stored in one tree, with the entry for the stem being the root of the tree.&lt;br /&gt;
&lt;br /&gt;
Symbols are not entered into the table until an assignment is made to the symbol. Once created, entries at the primary level are never removed, even if the symbol subsequently becomes uninitialized. Secondary trees are released whenever a new assignment is made to the stem associated with that tree.&lt;br /&gt;
&lt;br /&gt;
== Resource Tracking ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides complete tracking for all of the dynamically allocated resources that it uses to execute a program. These resources include memory space, DOS files and related structures, and the message port structure. The tracking system was designed to allow a program to shut down at any point without leaving any resources hanging.&lt;br /&gt;
&lt;br /&gt;
It is possible to go outside of the interpreter&#039;s resource tracking net by making calls directly to the Amiga operating system from within an ARexx program. It is the programmer&#039;s responsibility to trace and return any resources allocated outside of the ARexx resource tracking system. ARexx provides a special interrupt facility so that a program can retain control after an execution error, perform the required cleanup, and exit.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6886</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6886"/>
		<updated>2014-01-27T22:29:18Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
The command to start RexxMast should already be in the S:Startup-Sequence file. If the command has been removed from S:Startup-Sequence, we suggest that you add it to the S:User-Startup file.&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The Rx command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked. The &amp;quot;Rx&amp;quot; may be in any case, for example, &amp;quot;RX&amp;quot;, &amp;quot;rx&amp;quot; and &amp;quot;Rx&amp;quot; will all work the same.&lt;br /&gt;
&lt;br /&gt;
As long as your program is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command &#039;copy myfile.&#039; | | i &#039;prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* matched with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (&#039;) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY &#039;Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY &#039;Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY &#039;You are about&#039; age*365 &#039;days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names! This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot;Rx calc&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY &#039;All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot;i&amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = &#039;even&#039;&lt;br /&gt;
ELSE type = &#039;odd&#039;&lt;br /&gt;
SAY i &#039;is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot;i&amp;quot; by 2 equals 0, then set the variable &amp;quot;type&amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot;type&amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square(i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot;square&amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot;square&amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot;i&amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot;square&amp;quot;, retrieves the argument &amp;quot;i&amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY &#039;sum=&#039; sum &#039;sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot;PULLed&amp;quot; and if it does not equal &amp;quot;Q&amp;quot; (quit), the loop continues. If the response equals &amp;quot;Q&amp;quot; , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q&amp;quot; /*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6885</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6885"/>
		<updated>2014-01-27T11:47:30Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER (&#039;title&#039;, 20)&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039; (256*4,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
ARG string, length /*get arguments*/&lt;br /&gt;
length = MIN(length,60) /*compute length*/&lt;br /&gt;
return &#039;CENTER&#039; (string, length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. (SETCLIP() is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function GETCLIP() and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP (&#039;numbers&#039;)&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS (-5.35) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABBREV (&#039;fullname&#039;, &#039;ful&#039;) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV (&#039;almost&#039;, &#039;alm&#039;,4) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV (&#039;any&#039;,&#039;&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS(-5.35) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS(10) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDLIB (&amp;quot;rexxsupport.library&amp;quot;,0,-30,0) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;,-20 /*A gateway*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also SHOW(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the Exists or Omitted keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG(1) -&amp;gt; one&lt;br /&gt;
SAY ARG(2,&#039;O&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. &#039;1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also X2C(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY B2C(&#039;00110011&#039;) -&amp;gt; 3&lt;br /&gt;
SAY B2C(&#039;01100001&#039;) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITAND(&#039;0313&#039;x, &#039;FFF0&#039;x) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCHG(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCLR(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCOMP(&#039;7F&#039;x, &#039;FF&#039;x) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP(&#039;FF&#039;x, &#039;FF&#039;x) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITOR(&#039;0313&#039;x, &#039;00F&#039;x) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITSET(&#039;313&#039;x,2) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITTST(&#039;0313=x,4) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITXOR(&#039;0313&#039;x, &#039;001F&#039;x) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also C2X(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2B(&#039;abc&#039;) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2D(&#039;0020&#039;x) -&amp;gt; 32&lt;br /&gt;
SAY C2D(&#039;FFFF ffff&#039;x) -&amp;gt; -1&lt;br /&gt;
SAY C2D(&#039;FF0100&#039;x,2) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also C2B(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(&#039;abc&#039;) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6,&#039;+&#039;) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER (&#039;123456&#039;,3) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CLOSE(&#039;input&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the first position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcce&#039;) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcde&#039;) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE(&#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPRESS(&#039; why not &#039;) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS(&#039;++12-34-+&#039;, &#039;+-&#039;) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COPIES(&#039;abc&#039;,3) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2C(65) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2X(31) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lower case alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lower case characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts upper case alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digit strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATATYPE(&#039;123&#039;) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE(&#039;1a f2&#039;, &#039;X&#039;) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE(&#039;aBcde&#039;, &#039;L&#039;) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (&#039;NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() function also accepts optional second and third arguments to supply the date either in the form of internal system days or in the &#039;sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either &#039;I&#039; or &#039;S&#039;. The current date in system days can be retrieved using DATE(&#039;INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE(&#039;M&#039;) -&amp;gt; July&lt;br /&gt;
SAY DATE(S) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE(&#039;S&#039; ,DATE(&#039;I&#039;)+21) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE(&#039;W&#039; ,19890609, &#039;S&#039;) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELSTR(&#039;123456&#039;,2,3) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELWORD(&#039;Tell me a story&#039;,2,2) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD(&#039;one two three&#039;,3) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EOF(infile) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ERRORTEXT(41) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EXISTS(&#039;SYS:C/ED&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also IMPORT() and STORAGE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
count = EXPORT(&#039;0004 0000&#039;x, &#039;The answer&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY FIND(&#039;Now is the time&#039;, &#039;is the&#039;) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also GETSPACE().&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FREESPACE(&#039;00042000&#039;x,32) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FUZZ setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also SETCLIP(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP(&#039;numbers&#039;) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also FREESPACE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X (GETSPACE(32)) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY HASH(&#039;1&#039;) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also EXPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
extval = IMPORT(&#039;0004 0000&#039;x,8) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot;) -&amp;gt; 2&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot;) -&amp;gt; 0&lt;br /&gt;
SAY INDEX(&amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;,3) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INSERT(&#039;ab&#039;, &#039;12345&#039;) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT(&#039;123&#039;, &#039;++&#039;,3,5, &#039;-&#039;) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234234&#039;) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;123234&#039;,3) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;13579&#039;) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,3) -&amp;gt; 123&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LENGTH(&#039;three&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a WaitForChar() call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES(STDIN) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MAX(2.1,3,-1) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MIN(2.1,3,-1) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The file argument defines the logical name by which the file will be referenced. The filename is the external name of the file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also CLOSE(), READ(), and WRITE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OPEN(&#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039;) P-&amp;gt; 1&lt;br /&gt;
SAY OPEN(&#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OVERLAY(&#039;bb&#039;, &#039;abcd&#039;) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY(&#039;4&#039;, &#039;123&#039;,5,5, &#039;-&#039;) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(&#039;D&#039;) is equivalent to PRAGMA(&#039;D&#039;,&amp;quot;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA(&#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA(&#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;,STDOUT&lt;br /&gt;
SAY PRAGMA(&amp;quot;STACK&amp;quot;,8092) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also RANDU(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
thisroll = RANDOM(1,6) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM(1,6) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also RANDOM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU () /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also READLN(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READCH(&#039;input&#039;,10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also READCH(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READLN(&#039;MyFile&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also ADDLIB(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REMLIB(&#039;MyLibrary.library&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REVERSE(&#039;?ton yhw&#039;) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,4) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEHIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SEEK(&#039;input&#039;,10,&#039;B&#039;) -&amp;gt; 10&lt;br /&gt;
SAY SEEK(&#039;input&#039;,0,E&#039;) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;, &#039;DF0:s&#039;) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SIGN(12) -&amp;gt; 1&lt;br /&gt;
SAY SIGN(-33) -&amp;gt; -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE(1)-&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,3) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,0) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE(&#039;1 2 3&#039;,1, &#039;+&#039;) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied and defaults to the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also EXPORT().&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039; 248400&lt;br /&gt;
oldval = STORAGE(&#039;0004 0000&#039;x, &#039;The answer&#039;)&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x,,32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{&#039;B&#039; | &#039;L&#039; | &#039;T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;,&#039;L&#039;) -&amp;gt; &#039;say what?&lt;br /&gt;
SAY STRIP(&#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039;) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBSTR(&#039;123456&#039;,4,2) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR(&#039;myname&#039;,3,6, &#039;=&#039;) -&amp;gt; &#039;name==&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBWORD(&#039;Now is the time &#039;,2,2) -&amp;gt; &#039;is the&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol has been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SYMBOL(&#039;J&#039;) -&amp;gt; VAR&lt;br /&gt;
SAY SYMBOL(&#039;x&#039;) -&amp;gt; LIT&lt;br /&gt;
SAY SYMBOL(&#039;++&#039;) -&amp;gt; BAD &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME(&#039;C&#039;( -&amp;gt; 1:02 AM&lt;br /&gt;
SAY TIME(&#039;HOURS&#039;) -&amp;gt; 1&lt;br /&gt;
SAY TIME(&#039;M&#039;) -&amp;gt; 62&lt;br /&gt;
SAY TIME(&#039;N&#039;) -&amp;gt; 01:02:54&lt;br /&gt;
SAY TIME(&#039;S&#039;) -&amp;gt; 3720&lt;br /&gt;
call TIME(&#039;R&#039;) /*reset timer*/&lt;br /&gt;
SAY TIME(&#039;E&#039;) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; 01:02:00 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see Chapter 6) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ?ALL*/&lt;br /&gt;
SAY TRACE(&#039;Results&#039;) -&amp;gt; ?A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to upper case. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always of the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRANSLATE(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot;) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE(&amp;quot;low&amp;quot;) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE(&amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot;) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY length (TRIM(&#039; abc &#039;)) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRUNC(123.456) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC(123.456,4) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to upper case. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY UPPER(&#039;One Fine Day&#039;) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE(&#039;j&#039;) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters is in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY VERIFY(&#039;123456&#039;, &#039;0123456789&#039;) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY(&#039;123a56&#039;, &#039;0123456789&#039;) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039;) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORD(&#039;Now is the time &#039;,2) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDLENGTH(&#039;one two three&#039;,3) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDS(&amp;quot;You don&#039;t SAY!&amp;quot;) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITECH(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITELN(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2C(&#039;12ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(&#039;12 ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(61) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex,digits)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2D(&#039;1f&#039;) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;f&#039;) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE(,&#039;0A&#039;x) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP(&amp;quot;every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;,,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP(teststring1, T)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP(teststring1,T,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS(teststring1)&lt;br /&gt;
&lt;br /&gt;
CALL TIME(&#039;r&#039;)&lt;br /&gt;
SAY TIME(&#039;Civil&#039;) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME(&#039;h&#039;) /*Hours since midnight*/&lt;br /&gt;
SAY TIME(&#039;m&#039;) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME(&#039;s&#039;) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME(&#039;e&#039;) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE(TRACE()) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE(&#039;aBCdef&#039;) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE (&#039;abcdef&#039;, &#039;1234&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM(&#039; abc &#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC(123.456)&lt;br /&gt;
SAY &#039;$&#039;TRUNC(134566.123,2)&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER(&#039;aBCdef12&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE(&#039;abc&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;0123456789&#039;)&lt;br /&gt;
SAY VERIFY(&#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: WORD(string,n)*/&lt;br /&gt;
SAY WORD(&#039;Now is the time&#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH(&#039;Now is the time &#039;,4)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS(&#039;Now is the time&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;,&#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITECH(&#039;test&#039;, &#039;message&#039;) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITELN(&#039;test&#039;, &#039;message&#039;)&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C(&#039;616263&#039;) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X(xrange(&#039;f0&#039;x))&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;g&#039;)&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
  every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
  every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
  every good boy does fine.&lt;br /&gt;
  every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
    abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW (&#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot;) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB(&#039;rexxsupport.library&#039;, 0, -30,0)&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also FREEMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(ALLOCMEM(1000)) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X(ALLOCMEM (1000, &#039;00 01 00 0 1&#039;X)) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also OPENPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also ALLOCMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM(MemoryRequest)&lt;br /&gt;
SAY C2X(MyMem) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM(MyMem, MemoryRequest) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM(&#039;07C987B0&#039;x,1024)*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
command = GETARG(packet)&lt;br /&gt;
function = GETARG(packet,0) /*name string*/&lt;br /&gt;
arg1 = GETARG(packet,1) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also WAITPKT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
packet = GETPKT (&#039;MyPort&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also CLOSEPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
success = OPENPORT(&amp;quot;MyPort&amp;quot;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL REPLY(packet,10) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWDIR(&#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039;) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({&#039;A&#039; | &#039;D&#039; | &#039;H&#039; | &#039;T&#039; | &#039;L&#039; | &#039;M&#039; | &#039;P&#039; | &#039;R&#039; | &#039;S&#039; | &#039;T&#039; | &#039;V&#039; | &#039;W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;,,&#039;;&#039;) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;, &#039;REXX&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STATEF(&amp;quot;LIBS:REXXSupport.library&amp;quot;)&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6884</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6884"/>
		<updated>2014-01-27T11:36:03Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER (&#039;title&#039;, 20)&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039; (256*4,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
ARG string, length /*get arguments*/&lt;br /&gt;
length = MIN(length,60) /*compute length*/&lt;br /&gt;
return &#039;CENTER&#039; (string, length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. (SETCLIP() is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function GETCLIP() and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP (&#039;numbers&#039;)&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS (-5.35) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABBREV (&#039;fullname&#039;, &#039;ful&#039;) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV (&#039;almost&#039;, &#039;alm&#039;,4) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV (&#039;any&#039;,&#039;&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS(-5.35) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS(10) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDLIB (&amp;quot;rexxsupport.library&amp;quot;,0,-30,0) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;,-20 /*A gateway*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also SHOW(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the Exists or Omitted keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG(1) -&amp;gt; one&lt;br /&gt;
SAY ARG(2,&#039;O&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. `1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also X2C(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY B2C(&#039;00110011&#039;) -&amp;gt; 3&lt;br /&gt;
SAY B2C(&#039;01100001&#039;) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITAND(&#039;0313&#039;x, &#039;FFF0&#039;x) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCHG(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCLR(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCOMP(&#039;7F&#039;x, &#039;FF&#039;x) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP(&#039;FF&#039;x, &#039;FF&#039;x) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITOR(&#039;0313&#039;x, &#039;00F&#039;x) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITSET(&#039;313&#039;x,2) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITTST(&#039;0313=x,4) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITXOR(&#039;0313&#039;x, &#039;001F&#039;x) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also C2X(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2B(&#039;abc&#039;) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2D(&#039;0020&#039;x) -&amp;gt; 32&lt;br /&gt;
SAY C2D(&#039;FFFF ffff&#039;x) -&amp;gt; -1&lt;br /&gt;
SAY C2D(&#039;FF0100&#039;x,2) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also C2B(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(&#039;abc&#039;) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6,&#039;+&#039;) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER (&#039;123456&#039;,3) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CLOSE(&#039;input&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the first position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcce&#039;) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcde&#039;) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE(&#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPRESS(&#039; why not &#039;) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS(&#039;++12-34-+&#039;, &#039;+-&#039;) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COPIES(&#039;abc&#039;,3) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2C(65) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2X(31) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lower case alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lower case characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts upper case alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digit strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATATYPE(&#039;123&#039;) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE(&#039;1a f2&#039;, &#039;X&#039;) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE(&#039;aBcde&#039;, &#039;L&#039;) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (`NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() function also accepts optional second and third arguments to supply the date either in the form of internal system days or in the &#039;sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either &#039;I&#039; or &#039;S&#039;. The current date in system days can be retrieved using DATE(&#039;INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE(&#039;M&#039;) -&amp;gt; July&lt;br /&gt;
SAY DATE(S) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE(&#039;S&#039; ,DATE(&#039;I&#039;)+21) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE(&#039;W&#039; ,19890609, &#039;S&#039;) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELSTR(&#039;123456&#039;,2,3) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELWORD(&#039;Tell me a story&#039;,2,2) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD(&#039;one two three&#039;,3) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EOF(infile) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ERRORTEXT(41) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EXISTS(&#039;SYS:C/ED&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also IMPORT() and STORAGE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
count = EXPORT(&#039;0004 0000&#039;x, &#039;The answer&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY FIND(&#039;Now is the time&#039;, &#039;is the&#039;) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also GETSPACE().&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FREESPACE(&#039;00042000&#039;x,32) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FUZZ setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also SETCLIP(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP(&#039;numbers&#039;) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also FREESPACE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X (GETSPACE(32)) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY HASH(&#039;1&#039;) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also EXPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
extval = IMPORT(&#039;0004 0000&#039;x,8) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot;) -&amp;gt; 2&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot;) -&amp;gt; 0&lt;br /&gt;
SAY INDEX(&amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;,3) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INSERT(&#039;ab&#039;, &#039;12345&#039;) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT(&#039;123&#039;, &#039;++&#039;,3,5, &#039;-&#039;) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234234&#039;) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;123234&#039;,3) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;13579&#039;) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,3) -&amp;gt; 123&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LENGTH(&#039;three&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a WaitForChar() call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES(STDIN) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MAX(2.1,3,-1) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MIN(2.1,3,-1) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The file argument defines the logical name by which the file will be referenced. The filename is the external name of the file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also CLOSE(), READ(), and WRITE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OPEN(&#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039;) P-&amp;gt; 1&lt;br /&gt;
SAY OPEN(&#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OVERLAY(&#039;bb&#039;, &#039;abcd&#039;) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY(&#039;4&#039;, &#039;123&#039;,5,5, &#039;-&#039;) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(&#039;D&#039;) is equivalent to PRAGMA(&#039;D&#039;,&amp;quot;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA(&#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA(&#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;,STDOUT&lt;br /&gt;
SAY PRAGMA(&amp;quot;STACK&amp;quot;,8092) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also RANDU(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
thisroll = RANDOM(1,6) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM(1,6) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also RANDOM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU () /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also READLN(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READCH(&#039;input&#039;,10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also READCH(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READLN(&#039;MyFile&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also ADDLIB(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REMLIB(&#039;MyLibrary.library&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REVERSE(&#039;?ton yhw&#039;) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,4) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEHIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SEEK(&#039;input&#039;,10,&#039;B&#039;) -&amp;gt; 10&lt;br /&gt;
SAY SEEK(&#039;input&#039;,0,E&#039;) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;, &#039;DF0:s&#039;) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SIGN(12) -&amp;gt; 1&lt;br /&gt;
SAY SIGN(-33) -&amp;gt; -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE(1)-&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,3) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,0) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE(&#039;1 2 3&#039;,1, &#039;+&#039;) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied and defaults to the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also EXPORT().&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039; 248400&lt;br /&gt;
oldval = STORAGE(&#039;0004 0000&#039;x, &#039;The answer&#039;)&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x,,32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{`B&#039; | `L&#039; | `T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;,&#039;L&#039;) -&amp;gt; &#039;say what?&lt;br /&gt;
SAY STRIP(&#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039;) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBSTR(&#039;123456&#039;,4,2) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR(&#039;myname&#039;,3,6, &#039;=&#039;) -&amp;gt; &#039;name==&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBWORD(&#039;Now is the time &#039;,2,2) -&amp;gt; &#039;is the&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol has been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SYMBOL(&#039;J&#039;) -&amp;gt; VAR&lt;br /&gt;
SAY SYMBOL(&#039;x&#039;) -&amp;gt; LIT&lt;br /&gt;
SAY SYMBOL(&#039;++&#039;) -&amp;gt; BAD &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME(&#039;C&#039;( -&amp;gt; 1:02 AM&lt;br /&gt;
SAY TIME(&#039;HOURS&#039;) -&amp;gt; 1&lt;br /&gt;
SAY TIME(&#039;M&#039;) -&amp;gt; 62&lt;br /&gt;
SAY TIME(&#039;N&#039;) -&amp;gt; 01:02:54&lt;br /&gt;
SAY TIME(&#039;S&#039;) -&amp;gt; 3720&lt;br /&gt;
call TIME(&#039;R&#039;) /*reset timer*/&lt;br /&gt;
SAY TIME(&#039;E&#039;) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; 01:02:00 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see Chapter 6) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ?ALL*/&lt;br /&gt;
SAY TRACE(&#039;Results&#039;) -&amp;gt; ?A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to upper case. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always of the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRANSLATE(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot;) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE(&amp;quot;low&amp;quot;) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE(&amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot;) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY length (TRIM(&#039; abc &#039;)) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRUNC(123.456) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC(123.456,4) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to upper case. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY UPPER(&#039;One Fine Day&#039;) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE(&#039;j&#039;) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters is in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY VERIFY(&#039;123456&#039;, &#039;0123456789&#039;) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY(&#039;123a56&#039;, &#039;0123456789&#039;) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039;) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORD(&#039;Now is the time &#039;,2) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDLENGTH(&#039;one two three&#039;,3) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDS(&amp;quot;You don&#039;t SAY!&amp;quot;) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITECH(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITELN(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2C(&#039;12ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(&#039;12 ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(61) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex,digits)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2D(&#039;1f&#039;) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;f&#039;) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE(,&#039;0A&#039;x) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP(&amp;quot;every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;,,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP(teststring1, T)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP(teststring1,T,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS(teststring1)&lt;br /&gt;
&lt;br /&gt;
CALL TIME(&#039;r&#039;)&lt;br /&gt;
SAY TIME(&#039;Civil&#039;) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME(&#039;h&#039;) /*Hours since midnight*/&lt;br /&gt;
SAY TIME(&#039;m&#039;) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME(&#039;s&#039;) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME(&#039;e&#039;) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE(TRACE()) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE(&#039;aBCdef&#039;) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE (&#039;abcdef&#039;, &#039;1234&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM(&#039; abc &#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC(123.456)&lt;br /&gt;
SAY &#039;$&#039;TRUNC(134566.123,2)&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER(&#039;aBCdef12&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE(&#039;abc&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;0123456789&#039;)&lt;br /&gt;
SAY VERIFY(&#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: WORD(string,n)*/&lt;br /&gt;
SAY WORD(&#039;Now is the time&#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH(&#039;Now is the time &#039;,4)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS(&#039;Now is the time&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;,&#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITECH(&#039;test&#039;, &#039;message&#039;) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITELN(&#039;test&#039;, &#039;message&#039;)&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C(&#039;616263&#039;) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X(xrange(&#039;f0&#039;x))&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;g&#039;)&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
  every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
  every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
  every good boy does fine.&lt;br /&gt;
  every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
    abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW (&#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot;) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB(&#039;rexxsupport.library&#039;, 0, -30,0)&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also FREEMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(ALLOCMEM(1000)) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X(ALLOCMEM (1000, &#039;00 01 00 0 1&#039;X)) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also OPENPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also ALLOCMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM(MemoryRequest)&lt;br /&gt;
SAY C2X(MyMem) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM(MyMem, MemoryRequest) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM(&#039;07C987B0&#039;x,1024)*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name, or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
command = GETARG(packet)&lt;br /&gt;
function = GETARG(packet,0) /*name string*/&lt;br /&gt;
arg1 = GETARG(packet,1) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also WAITPKT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
packet = GETPKT (&#039;MyPort&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also CLOSEPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
success = OPENPORT(&amp;quot;MyPort&amp;quot;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL REPLY(packet,10) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWDIR(&#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039;) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({`A&#039; | `D&#039; | `H&#039; | `T&#039; | `L&#039; | `M&#039; | `P&#039; | `R&#039; | `S&#039; | `T&#039; | `V&#039; | `W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;,,&#039;;&#039;) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;, &#039;REXX&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STATEF(&amp;quot;LIBS:REXXSupport.library&amp;quot;)&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6883</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6883"/>
		<updated>2014-01-27T10:41:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER (&#039;title&#039;, 20)&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039; (256*4,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
ARG string, length /*get arguments*/&lt;br /&gt;
length = MIN(length,60) /*compute length*/&lt;br /&gt;
return &#039;CENTER&#039; (string, length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. (SETCLIP() is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function GETCLIP() and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP (&#039;numbers&#039;)&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS (-5.35) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABBREV (&#039;fullname&#039;, &#039;ful&#039;) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV (&#039;almost&#039;, &#039;alm&#039;,4) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV (&#039;any&#039;,&#039;&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS(-5.35) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS(10) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDLIB (&amp;quot;rexxsupport.library&amp;quot;,0,-30,0) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;,-20 /*A gateway*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also SHOW(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the Exists or Omitted keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG(1) -&amp;gt; one&lt;br /&gt;
SAY ARG(2,&#039;O&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. `1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also X2C(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY B2C(&#039;00110011&#039;) -&amp;gt; 3&lt;br /&gt;
SAY B2C(&#039;01100001&#039;) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITAND(&#039;0313&#039;x, &#039;FFF0&#039;x) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCHG(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCLR(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCOMP(&#039;7F&#039;x, &#039;FF&#039;x) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP(&#039;FF&#039;x, &#039;FF&#039;x) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITOR(&#039;0313&#039;x, &#039;00F&#039;x) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITSET(&#039;313&#039;x,2) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITTST(&#039;0313=x,4) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITXOR(&#039;0313&#039;x, &#039;001F&#039;x) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also C2X(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2B(&#039;abc&#039;) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2D(&#039;0020&#039;x) -&amp;gt; 32&lt;br /&gt;
SAY C2D(&#039;FFFF ffff&#039;x) -&amp;gt; -1&lt;br /&gt;
SAY C2D(&#039;FF0100&#039;x,2) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also C2B(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(&#039;abc&#039;) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6,&#039;+&#039;) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER (&#039;123456&#039;,3) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CLOSE(&#039;input&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the first position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcce&#039;) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcde&#039;) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE(&#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPRESS(&#039; why not &#039;) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS(&#039;++12-34-+&#039;, &#039;+-&#039;) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COPIES(&#039;abc&#039;,3) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2C(65) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2X(31) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lower case alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lower case characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts upper case alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digit strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATATYPE(&#039;123&#039;) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE(&#039;1a f2&#039;, &#039;X&#039;) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE(&#039;aBcde&#039;, &#039;L&#039;) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (`NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() function also accepts optional second and third arguments to supply the date either in the form of internal system days or in the &#039;sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either &#039;I&#039; or &#039;S&#039;. The current date in system days can be retrieved using DATE(&#039;INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE(&#039;M&#039;) -&amp;gt; July&lt;br /&gt;
SAY DATE(S) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE(&#039;S&#039; ,DATE(&#039;I&#039;)+21) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE(&#039;W&#039; ,19890609, &#039;S&#039;) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELSTR(&#039;123456&#039;,2,3) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELWORD(&#039;Tell me a story&#039;,2,2) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD(&#039;one two three&#039;,3) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EOF(infile) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ERRORTEXT(41) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EXISTS(&#039;SYS:C/ED&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also IMPORT() and STORAGE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
count = EXPORT(&#039;0004 0000&#039;x, &#039;The answer&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY FIND(&#039;Now is the time&#039;, &#039;is the&#039;) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also GETSPACE().&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FREESPACE(&#039;00042000&#039;x,32) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FUZZ setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also SETCLIP(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP(&#039;numbers&#039;) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also FREESPACE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X (GETSPACE(32)) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY HASH(&#039;1&#039;) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also EXPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
extval = IMPORT(&#039;0004 0000&#039;x,8) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot;) -&amp;gt; 2&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot;) -&amp;gt; 0&lt;br /&gt;
SAY INDEX(&amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;,3) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INSERT(&#039;ab&#039;, &#039;12345&#039;) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT(&#039;123&#039;, &#039;++&#039;,3,5, &#039;-&#039;) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234234&#039;) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;123234&#039;,3) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;13579&#039;) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,3) -&amp;gt; 123&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LENGTH(&#039;three&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a WaitForChar() call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES(STDIN) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MAX(2.1,3,-1) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MIN(2.1,3,-1) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The file argument defines the logical name by which the file will be referenced. The filename is the external name of the file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also CLOSE(), READ(), and WRITE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OPEN(&#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039;) P-&amp;gt; 1&lt;br /&gt;
SAY OPEN(&#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OVERLAY(&#039;bb&#039;, &#039;abcd&#039;) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY(&#039;4&#039;, &#039;123&#039;,5,5, &#039;-&#039;) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(&#039;D&#039;) is equivalent to PRAGMA(&#039;D&#039;,&amp;quot;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA(&#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA(&#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;,STDOUT&lt;br /&gt;
SAY PRAGMA(&amp;quot;STACK&amp;quot;,8092) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also RANDU(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
thisroll = RANDOM(1,6) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM(1,6) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also RANDOM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU () /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also READLN(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READCH(&#039;input&#039;,10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also READCH(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READLN(&#039;MyFile&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also ADDLIB(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REMLIB(&#039;MyLibrary.library&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REVERSE(&#039;?ton yhw&#039;) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,4) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEHIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SEEK(&#039;input&#039;,10,&#039;B&#039;) -&amp;gt; 10&lt;br /&gt;
SAY SEEK(&#039;input&#039;,0,E&#039;) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;, &#039;DF0:s&#039;) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SIGN(12) -&amp;gt; 1&lt;br /&gt;
SAY SIGN(-33) -&amp;gt; -1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE(1)-&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,3) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,0) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE(&#039;1 2 3&#039;,1, &#039;+&#039;) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied and defaults to the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also EXPORT().&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039; 248400&lt;br /&gt;
oldval = STORAGE(&#039;0004 0000&#039;x, &#039;The answer&#039;)&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x,,32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{`B&#039; | `L&#039; | `T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;,&#039;L&#039;) -&amp;gt; &#039;say what?&lt;br /&gt;
SAY STRIP(&#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039;) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBSTR(&#039;123456&#039;,4,2) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR(&#039;myname&#039;,3,6, &#039;=&#039;) -&amp;gt; &#039;name==&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBWORD(&#039;Now is the time &#039;,2,2) -&amp;gt; &#039;is the&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol has been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SYMBOL(&#039;J&#039;) -&amp;gt; VAR&lt;br /&gt;
SAY SYMBOL(&#039;x&#039;) -&amp;gt; LIT&lt;br /&gt;
SAY SYMBOL(&#039;++&#039;) -&amp;gt; BAD &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME(&#039;C&#039;( -&amp;gt; 1:02 AM&lt;br /&gt;
SAY TIME(&#039;HOURS&#039;) -&amp;gt; 1&lt;br /&gt;
SAY TIME(&#039;M&#039;) -&amp;gt; 62&lt;br /&gt;
SAY TIME(&#039;N&#039;) -&amp;gt; 01:02:54&lt;br /&gt;
SAY TIME(&#039;S&#039;) -&amp;gt; 3720&lt;br /&gt;
call TIME(&#039;R&#039;) /*reset timer*/&lt;br /&gt;
SAY TIME(&#039;E&#039;) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; 01:02:00 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see Chapter 6) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ?ALL*/&lt;br /&gt;
SAY TRACE(&#039;Results&#039;) -&amp;gt; ?A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to uppercase. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always for the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRANSLATE(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot;) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE(&amp;quot;low&amp;quot;) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE(&amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot;) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY length (TRIM(&#039; abc &#039;)) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRUNC(123.456) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC(123.456,4) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to uppercase. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY UPPER(&#039;One Fine Day&#039;) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE(&#039;j&#039;) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters are in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY VERIFY(&#039;123456&#039;, &#039;0123456789&#039;) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY(&#039;123a56&#039;, &#039;0123456789&#039;) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039;) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORD(&#039;Now is the time &#039;,2) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDLENGTH(&#039;one two three&#039;,3) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDS(&amp;quot;You don&#039;t SAY!&amp;quot;) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITECH(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITELN(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2C(&#039;12ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(&#039;12 ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(61) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex,digits)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2D(&#039;1f&#039;) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;f&#039;) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE(,&#039;0A&#039;x) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP(&amp;quot;every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;,,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP(teststring1, T)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP(teststring1,T,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS(teststring1)&lt;br /&gt;
&lt;br /&gt;
CALL TIME(&#039;r&#039;)&lt;br /&gt;
SAY TIME(&#039;Civil&#039;) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME(&#039;h&#039;) /*Hours since midnight*/&lt;br /&gt;
SAY TIME(&#039;m&#039;) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME(&#039;s&#039;) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME(&#039;e&#039;) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE(TRACE()) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE(&#039;aBCdef&#039;) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE (&#039;abcdef&#039;, &#039;1234&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM(&#039; abc &#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC(123.456)&lt;br /&gt;
SAY &#039;$&#039;TRUNC(134566.123,2)&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER(&#039;aBCdef12&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE(&#039;abc&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;0123456789&#039;)&lt;br /&gt;
SAY VERIFY(&#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: OWRD(string,n)*/&lt;br /&gt;
SAY WORD(&#039;Now is the time&#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH(&#039;Now is the time &#039;,4)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS(&#039;Now is the time&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;,&#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITECH(&#039;test&#039;, &#039;message&#039;) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITELN(&#039;test&#039;, &#039;message&#039;)&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C(&#039;616263&#039;) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X(xrange(&#039;f0&#039;x))&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;g&#039;)&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
 every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
 abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW (&#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot;) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB(&#039;rexxsupport.library&#039;, 0, -30,0)&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also FREEMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(ALLOCMEM(1000)) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X(ALLOCMEM (1000, &#039;00 01 00 0 1&#039;X)) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also OPENPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also ALLOCMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM(MemoryRequest)&lt;br /&gt;
SAY C2X(MyMem) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM(MyMem, MemoryRequest) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM(&#039;07C987B0&#039;x,1024)*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name, or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
command = GETARG(packet)&lt;br /&gt;
function = GETARG(packet,0) /*name string*/&lt;br /&gt;
arg1 = GETARG(packet,1) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also WAITPKT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
packet = GETPKT (&#039;MyPort&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also CLOSEPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
success = OPENPORT(&amp;quot;MyPort&amp;quot;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL REPLY(packet,10) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWDIR(&#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039;) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({`A&#039; | `D&#039; | `H&#039; | `T&#039; | `L&#039; | `M&#039; | `P&#039; | `R&#039; | `S&#039; | `T&#039; | `V&#039; | `W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;,,&#039;;&#039;) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;, &#039;REXX&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STATEF(&amp;quot;LIBS:REXXSupport.library&amp;quot;)&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6882</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6882"/>
		<updated>2014-01-27T10:22:44Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER (&#039;title&#039;, 20)&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039; (256*4,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
ARG string, length /*get arguments*/&lt;br /&gt;
length = MIN(length,60) /*compute length*/&lt;br /&gt;
return &#039;CENTER&#039; (string, length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. (SETCLIP() is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function GETCLIP() and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP (&#039;numbers&#039;)&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS (-5.35) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABBREV (&#039;fullname&#039;, &#039;ful&#039;) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV (&#039;almost&#039;, &#039;alm&#039;,4) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV (&#039;any&#039;,&#039;&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS(-5.35) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS(10) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDLIB (&amp;quot;rexxsupport.library&amp;quot;,0,-30,0) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;,-20 /*A gateway*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also SHOW(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the Exists or Omitted keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG(1) -&amp;gt; one&lt;br /&gt;
SAY ARG(2,&#039;O&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. `1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also X2C(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY B2C(&#039;00110011&#039;) -&amp;gt; 3&lt;br /&gt;
SAY B2C(&#039;01100001&#039;) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITAND(&#039;0313&#039;x, &#039;FFF0&#039;x) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCHG(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCLR(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCOMP(&#039;7F&#039;x, &#039;FF&#039;x) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP(&#039;FF&#039;x, &#039;FF&#039;x) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITOR(&#039;0313&#039;x, &#039;00F&#039;x) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITSET(&#039;313&#039;x,2) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITTST(&#039;0313=x,4) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITXOR(&#039;0313&#039;x, &#039;001F&#039;x) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also C2X(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2B(&#039;abc&#039;) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2D(&#039;0020&#039;x) -&amp;gt; 32&lt;br /&gt;
SAY C2D(&#039;FFFF ffff&#039;x) -&amp;gt; -1&lt;br /&gt;
SAY C2D(&#039;FF0100&#039;x,2) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also C2B(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(&#039;abc&#039;) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6,&#039;+&#039;) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER (&#039;123456&#039;,3) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CLOSE(&#039;input&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the first position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcce&#039;) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcde&#039;) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE(&#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPRESS(&#039; why not &#039;) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS(&#039;++12-34-+&#039;, &#039;+-&#039;) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COPIES(&#039;abc&#039;,3) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2C(65) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2X(31) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lower case alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lower case characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts upper case alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digit strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATATYPE(&#039;123&#039;) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE(&#039;1a f2&#039;, &#039;X&#039;) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE(&#039;aBcde&#039;, &#039;L&#039;) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (`NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() function also accepts optional second and third arguments to supply the date either in the form of internal system days or in the &#039;sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either &#039;I&#039; or &#039;S&#039;. The current date in system days can be retrieved using DATE(&#039;INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE(&#039;M&#039;) -&amp;gt; July&lt;br /&gt;
SAY DATE(S) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE(&#039;S&#039; ,DATE(&#039;I&#039;)+21) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE(&#039;W&#039; ,19890609, &#039;S&#039;) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELSTR(&#039;123456&#039;,2,3) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELWORD(&#039;Tell me a story&#039;,2,2) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD(&#039;one two three&#039;,3) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EOF(infile) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ERRORTEXT(41) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EXISTS(&#039;SYS:C/ED&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also IMPORT() and STORAGE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
count = EXPORT(&#039;0004 0000&#039;x, &#039;The answer&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY FIND(&#039;Now is the time&#039;, &#039;is the&#039;) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also GETSPACE().&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FREESPACE(&#039;00042000&#039;x,32) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FUZZ setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also SETCLIP(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP(&#039;numbers&#039;) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also FREESPACE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X (GETSPACE(32)) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY HASH(&#039;1&#039;) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also EXPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
extval = IMPORT(&#039;0004 0000&#039;x,8) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot;) -&amp;gt; 2&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot;) -&amp;gt; 0&lt;br /&gt;
SAY INDEX(&amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;,3) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INSERT(&#039;ab&#039;, &#039;12345&#039;) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT(&#039;123&#039;, &#039;++&#039;,3,5, &#039;-&#039;) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234234&#039;) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;123234&#039;,3) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;13579&#039;) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,3) -&amp;gt; 123&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LENGTH(&#039;three&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a WaitForChar() call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES(STDIN) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MAX(2.1,3,-1) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MIN(2.1,3,-1) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The file argument defines the logical name by which the file will be referenced. The filename is the external name of the file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also CLOSE(), READ(), and WRITE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OPEN(&#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039;) P-&amp;gt; 1&lt;br /&gt;
SAY OPEN(&#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OVERLAY(&#039;bb&#039;, &#039;abcd&#039;) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY(&#039;4&#039;, &#039;123&#039;,5,5, &#039;-&#039;) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(&#039;D&#039;) is equivalent to PRAGMA(&#039;D&#039;,&#039;&#039;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA(&#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA(&#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;,STDOUT&lt;br /&gt;
SAY PRAGMA(&amp;quot;STACK&amp;quot;,8092) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also RANDU(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
thisroll = RANDOM(1,6) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM(1,6) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also RANDOM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU () /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also READLN(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READCH(&#039;input&#039;,10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also READCH(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READLN(&#039;MyFile&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also ADDLIB(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REMLIB(&#039;MyLibrary.library&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REVERSE(&#039;?ton yhw&#039;) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,4) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEHIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SEEK(&#039;input&#039;,10,&#039;B&#039;) -&amp;gt; 10&lt;br /&gt;
SAY SEEK(&#039;input&#039;,0,E&#039;) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;, &#039;DF0:s&#039;) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SIGN(12) -&amp;gt; 1&lt;br /&gt;
SAY SIGN(-33) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE(1)-&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,3) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,0) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE(&#039;1 2 3&#039;,1, &#039;+&#039;) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied defaults to the length of the string. if the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also EXPORT().&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039; 248400&lt;br /&gt;
oldval = STORAGE(&#039;0004 0000&#039;x, &#039;The answer&#039;)&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x,,32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{`B&#039; | `L&#039; | `T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;,&#039;L&#039;) -&amp;gt; &#039;say what?&lt;br /&gt;
SAY STRIP(&#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039;) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBSTR(&#039;123456&#039;,4,2) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR(&#039;myname&#039;,3,6, &#039;=&#039;) -&amp;gt; name==&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBWORD(&#039;Now is the time &#039;,2,2) -&amp;gt; is the &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol ha been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SYMBOL(&#039;J&#039;) -&amp;gt; VAR&lt;br /&gt;
SAY SYMBOL(&#039;x&#039;) -&amp;gt; LIT&lt;br /&gt;
SAY SYMBOL(&#039;++&#039;) -&amp;gt; BAD &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME(&#039;C&#039;( -&amp;gt; 1:02 AM&lt;br /&gt;
SAY TIME(&#039;HOURS&#039;) -&amp;gt; 1&lt;br /&gt;
SAY TIME(&#039;M&#039;) -&amp;gt; 62&lt;br /&gt;
SAY TIME(&#039;N&#039;) -&amp;gt; 01:02:54&lt;br /&gt;
SAY TIME(&#039;S&#039;) -&amp;gt; 3720&lt;br /&gt;
call TIME(&#039;R&#039;) /*reset timer*/&lt;br /&gt;
SAY TIME(&#039;E&#039;) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; 01:02:00 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see Chapter 6) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ?ALL*/&lt;br /&gt;
SAY TRACE(&#039;Results&#039;) -&amp;gt; ?A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to uppercase. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always for the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRANSLATE(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot;) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE(&amp;quot;low&amp;quot;) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE(&amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot;) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY length (TRIM(&#039; abc &#039;)) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRUNC(123.456) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC(123.456,4) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to uppercase. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY UPPER(&#039;One Fine Day&#039;) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE(&#039;j&#039;) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters are in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY VERIFY(&#039;123456&#039;, &#039;0123456789&#039;) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY(&#039;123a56&#039;, &#039;0123456789&#039;) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039;) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORD(&#039;Now is the time &#039;,2) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDLENGTH(&#039;one two three&#039;,3) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDS(&amp;quot;You don&#039;t SAY!&amp;quot;) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITECH(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITELN(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2C(&#039;12ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(&#039;12 ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(61) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex,digits)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2D(&#039;1f&#039;) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;f&#039;) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE(,&#039;0A&#039;x) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP(&amp;quot;every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;,,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP(teststring1, T)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP(teststring1,T,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS(teststring1)&lt;br /&gt;
&lt;br /&gt;
CALL TIME(&#039;r&#039;)&lt;br /&gt;
SAY TIME(&#039;Civil&#039;) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME(&#039;h&#039;) /*Hours since midnight*/&lt;br /&gt;
SAY TIME(&#039;m&#039;) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME(&#039;s&#039;) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME(&#039;e&#039;) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE(TRACE()) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE(&#039;aBCdef&#039;) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE (&#039;abcdef&#039;, &#039;1234&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM(&#039; abc &#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC(123.456)&lt;br /&gt;
SAY &#039;$&#039;TRUNC(134566.123,2)&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER(&#039;aBCdef12&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE(&#039;abc&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;0123456789&#039;)&lt;br /&gt;
SAY VERIFY(&#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: OWRD(string,n)*/&lt;br /&gt;
SAY WORD(&#039;Now is the time&#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH(&#039;Now is the time &#039;,4)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS(&#039;Now is the time&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;,&#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITECH(&#039;test&#039;, &#039;message&#039;) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITELN(&#039;test&#039;, &#039;message&#039;)&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C(&#039;616263&#039;) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X(xrange(&#039;f0&#039;x))&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;g&#039;)&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
 every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
 abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW (&#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot;) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB(&#039;rexxsupport.library&#039;, 0, -30,0)&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also FREEMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(ALLOCMEM(1000)) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X(ALLOCMEM (1000, &#039;00 01 00 0 1&#039;X)) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also OPENPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also ALLOCMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM(MemoryRequest)&lt;br /&gt;
SAY C2X(MyMem) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM(MyMem, MemoryRequest) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM(&#039;07C987B0&#039;x,1024)*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name, or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
command = GETARG(packet)&lt;br /&gt;
function = GETARG(packet,0) /*name string*/&lt;br /&gt;
arg1 = GETARG(packet,1) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also WAITPKT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
packet = GETPKT (&#039;MyPort&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also CLOSEPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
success = OPENPORT(&amp;quot;MyPort&amp;quot;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL REPLY(packet,10) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWDIR(&#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039;) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({`A&#039; | `D&#039; | `H&#039; | `T&#039; | `L&#039; | `M&#039; | `P&#039; | `R&#039; | `S&#039; | `T&#039; | `V&#039; | `W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;,,&#039;;&#039;) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;, &#039;REXX&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STATEF(&amp;quot;LIBS:REXXSupport.library&amp;quot;)&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6881</id>
		<title>AmigaOS Manual: ARexx Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Functions&amp;diff=6881"/>
		<updated>2014-01-27T06:15:57Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a program or group of statements that is executed whenever that function name is called in a particular context. A function may be part of an internal program, part of a library, or a separate external program. Functions are an important building block of modular programming because they allow you to construct large programs from a series of small, easily developed modules.&lt;br /&gt;
&lt;br /&gt;
This chapter explains the different types of functions and how they are evaluated. It also provides an alphabetical reference of ARexx&#039;s built-in function library.&lt;br /&gt;
&lt;br /&gt;
= Invoking a Function =&lt;br /&gt;
&lt;br /&gt;
Within a ARexx program, a function is defined as a symbol or string followed immediately by an open parenthesis. The symbol or string (taken as a literal) specifies the function name, and the open parenthesis begins the argument list. Between the opening and closing parentheses are zero or more argument expressions, separated by commas, that supply the data being passed to the function.&lt;br /&gt;
&lt;br /&gt;
Valid function calls are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER (&#039;title&#039;, 20)&lt;br /&gt;
ADDRESS()&lt;br /&gt;
&#039;ALLOCMEM&#039; (256*4,1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each argument expression is evaluated in turn and the resulting strings are passed as the argument list to the function. Each argument expression, while often just a single literal value, can include arithmetic or string operations or even other function calls. Argument expressions are evaluated from left to right.&lt;br /&gt;
&lt;br /&gt;
Functions can also be invoked using the CALL instruction. The CALL instruction, described in Chapter 4, can be used to invoke a function that may not return a value.&lt;br /&gt;
&lt;br /&gt;
= Types of Functions =&lt;br /&gt;
&lt;br /&gt;
There are three types of functions:&lt;br /&gt;
&lt;br /&gt;
* Internal functions - defined within the ARexx program.&lt;br /&gt;
* Built-in functions - supplied by the ARexx programming language.&lt;br /&gt;
* Function Libraries - a special Amiga shared library.&lt;br /&gt;
&lt;br /&gt;
== Internal Functions ==&lt;br /&gt;
&lt;br /&gt;
An internal function is identified by a label within the program. When the internal function is called. ARexx creates a new storage environment so that the previous caller&#039;s environment is preserved. The new environment inherits the values from its predecessor, but subsequent changes to the environment variables do not affect the previous environment.&lt;br /&gt;
&lt;br /&gt;
The specific values preserved are:&lt;br /&gt;
&lt;br /&gt;
* The current and previous host addresses.&lt;br /&gt;
* The NUMERIC DIGITS, FUZZ, and FORM settings.&lt;br /&gt;
* The trace option, inhibit flag, and interactive flag.&lt;br /&gt;
* The state of the interrupt flags as defined by the SIGNAL instruction.&lt;br /&gt;
* The current prompt string as set by the OPTIONS PROMPT instruction.&lt;br /&gt;
&lt;br /&gt;
The new environment does not automatically get a new symbol table, so initially all of the variables in the previous environment are available to the called function. The PROCEDURE instruction can be used to create a table and thereby protect the caller&#039;s symbol values. PROCEDURE can also be used to allow the same variable name to be used in two different areas with two different values.&lt;br /&gt;
&lt;br /&gt;
Execution of the internal function proceeds until a RETURN instruction is executed. At this point the new environment is dismantled, and control resumes at the point of the function call. The expression supplied with the RETURN instruction is evaluated and passed back to the caller as the function result.&lt;br /&gt;
&lt;br /&gt;
== Built-In Functions ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides a substantial library of predefined functions as part of the language system. These functions are always available and have been optimized to work with the internal data structures. In general, the built-in functions execute much faster than an equivalent interpreted function, so their usage is strongly recommended.&lt;br /&gt;
&lt;br /&gt;
Several of the built-in functions create and manipulate external AmigaDOS files. Files are referenced by a logical name, a case-sensitive name that is assigned to a file when it is first opened. The initial input and output streams are given the names STDIN (standard input) and STDOUT (standard output). There is no theoretical limit to the number of files that may be open simultaneously, although a limit will be imposed by available memory. All open files are closed automatically when the program exits.&lt;br /&gt;
&lt;br /&gt;
== External Function Libraries ==&lt;br /&gt;
&lt;br /&gt;
A function library is a collection of one or more functions organized as an Amiga shared library. The library must reside in LIBS:, but may be either memory or disk-resident. Disk-resident libraries are loaded and opened as needed.&lt;br /&gt;
&lt;br /&gt;
The library has to be especially tailored for use by ARexx. Each function library must contain a library name, a search priority, an entry point offset, and a version number. When ARexx is searching for a function, the interpreter opens each library and checks its &amp;quot;query&amp;quot; entry point. This entry point must be specified as an integer offset (e.g. &amp;quot;-30&amp;quot;) from the library base. The return code from the query call indicates whether the desired function was found. If the function is found, it is called with the parameters passed by the interpreter, and the function result is returned to the caller. If it is not found, a &amp;quot;Function not found&amp;quot; error code is returned, and the search continues with the next library in the list. Function libraries are always closed after being checked so that the operating system can reclaim the memory space if required.&lt;br /&gt;
&lt;br /&gt;
=== The Library List ===&lt;br /&gt;
&lt;br /&gt;
The ARexx resident process maintains a list of the currently available function libraries and function hosts called the Library List. Application programs can add or remove function libraries as required.&lt;br /&gt;
&lt;br /&gt;
The Library List is maintained as a priority-sorted queue. Each entry has an associated search priority in the range 100 (highest) to -100 (lowest). Entries can be added at an appropriate priority to control the function name resolution. Libraries with higher priorities are searched first. Within a given priority level, those libraries added first are searched first. The priority levels are significant if any of the libraries have duplicate function name definitions, since the function located further down the search chain could never be called.&lt;br /&gt;
&lt;br /&gt;
== External Function Hosts ==&lt;br /&gt;
&lt;br /&gt;
The name associated with a function host is the name of its public message port. Function calls are passed to the host as a message packet; it is then up to the individual host to determine whether the specified function name is one that it recognizes. The name resolution is completely internal to the host, so function hosts provide a natural gateway mechanism for implementing remote procedure calls to other machines in a network. The ARexx resident process is a function host and is installed in the Library List with a priority of -60.&lt;br /&gt;
&lt;br /&gt;
= The Search Order =&lt;br /&gt;
&lt;br /&gt;
Function linkages in ARexx are established at the time of the function call. A specific search order is followed until a function matching the name symbol or string is found. If the specified function cannot be located, an error is generated and the expression evaluation is terminated. The full search order is:&lt;br /&gt;
&lt;br /&gt;
; Internal Functions&lt;br /&gt;
: The program source is examined for a label that matches the function name. If a match is found, a new storage environment is created and control is transferred to the label.&lt;br /&gt;
&lt;br /&gt;
; Built-In Functions&lt;br /&gt;
: The built-in function library is searched for the specified name. All of these functions are defined by uppercase names.&lt;br /&gt;
&lt;br /&gt;
; Function Libraries and Function Hosts&lt;br /&gt;
: The available function libraries and function hosts are maintained in the Library List, which is searched starting at the highest priority until the requested function is found or the end of the list is reached. Function hosts are called using a message-passing protocol similar to that used for commands and may be used as gateways for remote procedure calls to other machines in a network.&lt;br /&gt;
&lt;br /&gt;
; External ARexx Programs&lt;br /&gt;
: The final search step is to check for an external ARexx program file by sending an invocation message to the ARexx resident process. The search always begins in the current directory and follows the same search path as the original ARexx program invocation. The name matching process is not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
The function name-matching procedure may be case-sensitive for some of the search steps, but not for others. The matching procedure used in a function library or function host is design dependent. Functions defined with mixed-case names must be called using a string token, since symbol names are always translated to uppercase.&lt;br /&gt;
&lt;br /&gt;
The full search order is followed whenever the function name is defined by a symbol token. However, the search for internal functions is bypassed if the name is specified by a string token. This allows internal functions to usurp the names of external functions, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CENTER: /*internal &amp;quot;CENTER&amp;quot;*/&lt;br /&gt;
ARG string, length /*get arguments*/&lt;br /&gt;
length = MIN(length,60) /*compute length*/&lt;br /&gt;
return &#039;CENTER&#039; (string, length)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the built-in function CENTER() has been replaced by an internal function after modifying the length argument.&lt;br /&gt;
&lt;br /&gt;
= The Clip List =&lt;br /&gt;
&lt;br /&gt;
The Clip List is a publicly accessible mechanism that can be used as a general clipboard for intertask communication. Many functions use the clipboard for retrieving different types of information, such as predefined constants or strings.&lt;br /&gt;
&lt;br /&gt;
The Clip List maintains a set of (name, value) pairs that may be used for a variety of purposes. (SETCLIP() is used to add pairs to the list.) Each entry in the list consists of a name and a value string and may be located by name. In general, the names used should be chosen to be unique to an application to prevent unintended duplications with other programs. Any number of entries may be posted to the list.&lt;br /&gt;
&lt;br /&gt;
One potential application for the Clip List is as a mechanism for loading predefined constants into an ARexx program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pi=3.14159; e=2.718; sqrt2=1.414 . . .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(i.e., a series of assignments separated by semicolons). In use, such a string could be retrieved by name using the built-in function GETCLIP() and then INTERPRETed within the program. The assignment statements within the string would then create the required constant definitions. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume a string called &amp;quot;numbers&amp;quot; is available*/&lt;br /&gt;
numbers = GETCLIP (&#039;numbers&#039;)&lt;br /&gt;
INTERPRET numbers /*. . . assignments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The strings would not be restricted to contain only assignment statements, but could include any valid ARexx statements. The Clip List could thus provide a series of programs for initializations or other processing tasks.&lt;br /&gt;
&lt;br /&gt;
The resident process supports addition and deletion operations for maintaining the Clip List. The names in the (name,value) pairs are assumed to be in mixed case and are maintained to be unique in the list. An attempt to add a string with an existing name will simply update the value string. The name and value strings are copied when an entry is posted to the list, so the program that adds an entry is not required to maintain the strings.&lt;br /&gt;
&lt;br /&gt;
Entries posted to the Clip List remain available until explicitly removed. The Clip List is automatically released when the resident process exits.&lt;br /&gt;
&lt;br /&gt;
= Built-in Functions Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of the built-in functions. The syntax of each function is shown to the right of the function keyword.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
Optional arguments are shown in brackets and generally have a default value that is used if the argument is omitted. When an option keyword is specified as an argument, only the first character is significant. Option keywords are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Many functions accept a pad character argument. Pad characters are inserted to fill or create spaces. For functions that accept a pad argument, only the first character of the argument string is significant. If a null string is supplied, the default padding character, usually a blank, will be used.&lt;br /&gt;
&lt;br /&gt;
In the following examples, an arrow (-&amp;gt;) is used as an abbreviation for &amp;quot;evaluates as.&amp;quot; The arrow will not be displayed when a program is run. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS (-5.35) -&amp;gt; 5.35&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that SAY ABS(-5.35) is evaluated as 5.35.&lt;br /&gt;
&lt;br /&gt;
== Alphabetical Reference ==&lt;br /&gt;
&lt;br /&gt;
=== ABBREV() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABBREV(string1,string2[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a Boolean value that indicates whether string2 is an abbreviation of string1 with length greater than or equal to the specified length argument. The default length is 0, so the null string is an acceptable abbreviation. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABBREV (&#039;fullname&#039;, &#039;ful&#039;) -&amp;gt; 1&lt;br /&gt;
SAY ABBREV (&#039;almost&#039;, &#039;alm&#039;,4) -&amp;gt; 0&lt;br /&gt;
SAY ABBREV (&#039;any&#039;,&#039;&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ABS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ABS(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the absolute value of the number argument. This value must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ABS(-5.35) -&amp;gt; 5.35&lt;br /&gt;
SAY ABS(10) -&amp;gt; 10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDLIB(name,priority[,offset,version])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a function library or a function host to the library list maintained by the resident process. The name argument specifies either the name of a function library or the public message port associated with a function host. The name is case-sensitive. Any specified libraries should reside in the system LIBS: directory.&lt;br /&gt;
&lt;br /&gt;
The priority argument specifies the search priority and must be an integer between 100 and -100, inclusive. The offset and version arguments apply only to libraries. The offset is the integer offset to the library&#039;s &amp;quot;query&amp;quot; entry point, and the version is an integer specifying the minimum acceptable release level of the library.&lt;br /&gt;
&lt;br /&gt;
The function returns a Boolean result that indicates whether the operation was successful. If a library is specified, it is not actually opened at this time. Similarly, ARexx does not check to see whether a specified function host port is open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDLIB (&amp;quot;rexxsupport.library&amp;quot;,0,-30,0) -&amp;gt; 1&lt;br /&gt;
CALL ADDLIB &amp;quot;EtherNet&amp;quot;,-20 /*A gateway*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADDRESS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current host address string. The host address is the message port to which commands will be sent. The SHOW() function can be used to check whether the required external host is actually available. See also SHOW(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ADDRESS() -&amp;gt; REXX &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ARG() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG([number][,&#039;EXISTS&#039;|&#039;OMITTED&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG() returns the number of arguments supplied to the current environment. If only the number parameter is supplied, the corresponding argument string is returned. If a number and the Exists or Omitted keyword is given, the Boolean return indicates the status of the corresponding argument. The existence or omission test does not indicate whether the string has a null value, but only whether a string was supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume arguments were: (&#039;one&#039;,,10)*/&lt;br /&gt;
SAY ARG() -&amp;gt; 3&lt;br /&gt;
SAY ARG(1) -&amp;gt; one&lt;br /&gt;
SAY ARG(2,&#039;O&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== B2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;B2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of binary digits (0,1) into the corresponding (packed) character representation. The conversion is the same as though the argument string had been specified as a literal binary string (e.g. `1010&#039;B). Blanks are permitted in the string, but only at byte boundaries. This function is particularly useful for creating strings that are to be used as bit masks. See also X2C(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY B2C(&#039;00110011&#039;) -&amp;gt; 3&lt;br /&gt;
SAY B2C(&#039;01100001&#039;) -&amp;gt; a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITAND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITAND(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ANDed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string, string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITAND(&#039;0313&#039;x, &#039;FFF0&#039;x) -&amp;gt; &#039;0310&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCHG() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCHG(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCHG(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCLR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCLR(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clears (sets to zero) the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCLR(&#039;0313&#039;x,4) -&amp;gt; &#039;0303&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITCOMP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITCOMP(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares the argument strings bit-by-bit, starting at bit number 0. The returned value is the bit number of the first bit in which the strings differ, or -1 if the strings are identical. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITCOMP(&#039;7F&#039;x, &#039;FF&#039;x) -&amp;gt; 7 /*Seventh bit*/&lt;br /&gt;
BITCOMP(&#039;FF&#039;x, &#039;FF&#039;x) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded in the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITOR(&#039;0313&#039;x, &#039;00F&#039;x) -&amp;gt; &#039;033F&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITSET() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITSET(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the specified bit in the argument string to 1. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITSET(&#039;313&#039;x,2) -&amp;gt; &#039;0317&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITTST() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITTST(string,bit)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Boolean return indicates the state of the specified bit in the argument string. Bit numbers are defined such that bit 0 is the low-order bit of the rightmost byte of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITTST(&#039;0313=x,4) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BITXOR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BITXOR(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument strings are logically and exclusively-ORed together, with the length of the result being the longer of the two operand strings. If a pad character is supplied, the shorter string is padded on the right. Otherwise, the operation terminates at the end of the shorter string, and the remainder of the longer string is appended to the result. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
BITXOR(&#039;0313&#039;x, &#039;001F&#039;x) -&amp;gt; &#039;030C&#039;X &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2B() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2B(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the character string into the equivalent string of binary digits. See also C2X(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2B(&#039;abc&#039;) -&amp;gt; 011000010110001001100011&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2D(string[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding decimal number, expressed as ASCII digits (0-9). If n is supplied, the character string is considered to be a number expressed in n bytes. The string is truncated or padded with nulls on the left as required, and the sign bit is extended for the conversion. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2D(&#039;0020&#039;x) -&amp;gt; 32&lt;br /&gt;
SAY C2D(&#039;FFFF ffff&#039;x) -&amp;gt; -1&lt;br /&gt;
SAY C2D(&#039;FF0100&#039;x,2) -&amp;gt; 256&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;C2X(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts the string argument from its character representation to the corresponding hexadecimal number, expressed as the ASCII characters 0-9 and A-F. See also C2B(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(&#039;abc&#039;) -&amp;gt; 616263 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CENTER()/CENTRE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTER(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CENTRE(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centers the string argument in a string with the specified length. If the length is longer than that of the string, pad characters or blanks are added as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6) -&amp;gt; &#039; abc &#039;&lt;br /&gt;
SAY CENTER(&#039;abc&#039;,6,&#039;+&#039;) -&amp;gt; &#039;+abc++&#039;&lt;br /&gt;
SAY CENTER (&#039;123456&#039;,3) -&amp;gt; &#039;234&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CLOSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSE(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the file specified by the given logical name. The returned value is a Boolean success flag and will be 1 unless the specified file was not open. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY CLOSE(&#039;input&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPARE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPARE(string1,string2[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compares two strings and returns the index of the fist position in which they differ or 0 if the strings are identical. The shorter string is padded as required using the supplied character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcce&#039;) -&amp;gt; 4&lt;br /&gt;
SAY COMPARE(&#039;abcde&#039;, &#039;abcde&#039;) -&amp;gt; 0&lt;br /&gt;
SAY COMPARE(&#039;abc++&#039;, &#039;abc+-&#039;, &#039;+&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COMPRESS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COMPRESS(string[,list])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the list argument is omitted, the function removes leading, trailing or embedded blank characters from the string argument. If the optional list is supplied, it specifies the characters to be removed from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COMPRESS(&#039; why not &#039;) -&amp;gt; whynot&lt;br /&gt;
SAY COMPRESS(&#039;++12-34-+&#039;, &#039;+-&#039;) -&amp;gt; 1234&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== COPIES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;COPIES(string,number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a new string by concatenating the specified number of copies of the original. The number argument may be zero, in which case the null string is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY COPIES(&#039;abc&#039;,3) -&amp;gt; abcabcabc &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2C() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2C(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string whose value is the binary (packed) representation of the given decimal number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2C(65) -&amp;gt; A &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D2X() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;D2X(number[,digits])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a decimal number to hexadecimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
D2X(31) -&amp;gt; 1F &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATATYPE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATATYPE(string[,option])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If only the string argument is specified, DATATYPE() tests whether the string parameter is a valid number and returns either NUM or CHAR. If an option keyword is given, the Boolean return indicates whether the string satisfied the requested test. The following option keywords are recognized:&lt;br /&gt;
&lt;br /&gt;
; ALPHANUMERIC&lt;br /&gt;
: Accepts alphabetic (A-Z, a-z) or numeric (0-9) characters&lt;br /&gt;
&lt;br /&gt;
; BINARY&lt;br /&gt;
: Accepts a binary digits string&lt;br /&gt;
&lt;br /&gt;
; LOWERCASE&lt;br /&gt;
: Accepts lowercase alphabetic (a-z) characters&lt;br /&gt;
&lt;br /&gt;
; MIXED&lt;br /&gt;
: Accepts mixed upper/lowercase characters&lt;br /&gt;
&lt;br /&gt;
; NUMERIC&lt;br /&gt;
: Accepts valid numbers&lt;br /&gt;
&lt;br /&gt;
; SYMBOL&lt;br /&gt;
: Accepts valid REXX symbols&lt;br /&gt;
&lt;br /&gt;
; UPPER&lt;br /&gt;
: Accepts uppercase alphabetic (A-Z) characters&lt;br /&gt;
&lt;br /&gt;
; WHOLE&lt;br /&gt;
: Accepts integer numbers&lt;br /&gt;
&lt;br /&gt;
; X&lt;br /&gt;
: Accepts Hex digits strings&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATATYPE(&#039;123&#039;) -&amp;gt; NUM&lt;br /&gt;
SAY DATATYPE(&#039;1a f2&#039;, &#039;X&#039;) -&amp;gt; 1&lt;br /&gt;
SAY DATATYPE(&#039;aBcde&#039;, &#039;L&#039;) -&amp;gt; 0 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DATE([option][,date][format])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current date in the specified format. The default (`NORMAL&#039;) option returns the date in the form DD MMM YYYY, as in 20 APR 1988. The options recognized are:&lt;br /&gt;
&lt;br /&gt;
; BASEDATE&lt;br /&gt;
: The number of days since January 1, 0001&lt;br /&gt;
&lt;br /&gt;
; CENTURY&lt;br /&gt;
: The number of days since January 1 of the century&lt;br /&gt;
&lt;br /&gt;
; DAYS&lt;br /&gt;
: The number of days since January 1 of the current year&lt;br /&gt;
&lt;br /&gt;
; EUROPEAN&lt;br /&gt;
: The date in the form DD/MM/YY&lt;br /&gt;
&lt;br /&gt;
; INTERNAL&lt;br /&gt;
: Internal system days&lt;br /&gt;
&lt;br /&gt;
; JULIAN&lt;br /&gt;
: The date in the form YYDDD&lt;br /&gt;
&lt;br /&gt;
; MONTH&lt;br /&gt;
: The current month (in mixed case)&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: The date in the form DD MMM YYYY&lt;br /&gt;
&lt;br /&gt;
; ORDERED&lt;br /&gt;
: The date in the form YY/MM/DD&lt;br /&gt;
&lt;br /&gt;
; SORTED&lt;br /&gt;
: The date in the form YYYYMMDD&lt;br /&gt;
&lt;br /&gt;
; USA&lt;br /&gt;
: The date in the form MM/DD/YY&lt;br /&gt;
&lt;br /&gt;
; WEEKDAY&lt;br /&gt;
: The day of the week (in mixed case)&lt;br /&gt;
&lt;br /&gt;
These options can be shortened to just the first character.&lt;br /&gt;
&lt;br /&gt;
The DATE() functions also accepts optional second and third arguments to supply the date either in the form of internal system days or in the `sorted&#039; form YYYYMMDD. The second argument is specifying either system days (the default) or a sorted date. The third argument specifies the form of the date and can be either `I&#039; or `S&#039;. The current date in system days can be retrieved using DATE(`INTERNAL&#039;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DATE() -&amp;gt; 14 Jul 1992&lt;br /&gt;
SAY DATE(&#039;M&#039;) -&amp;gt; July&lt;br /&gt;
SAY DATE(S) -&amp;gt; 19920714&lt;br /&gt;
SAY DATE(&#039;S&#039; ,DATE(&#039;I&#039;)+21) -&amp;gt; 19920804&lt;br /&gt;
SAY DATE(&#039;W&#039; ,19890609, &#039;S&#039;) -&amp;gt; Friday &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELSTR(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth character for the specified length in characters. The default length is the remaining length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELSTR(&#039;123456&#039;,2,3) -&amp;gt; 156&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DELWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DELWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Deletes the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The deleted string includes any trailing blanks following the last word. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY DELWORD(&#039;Tell me a story&#039;,2,2) -&amp;gt; &#039;Tell story&#039;&lt;br /&gt;
SAY DELWORD(&#039;one two three&#039;,3) -&amp;gt; &#039;one two &#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIGITS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DIGITS()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current Numeric Digits setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 6&lt;br /&gt;
SAY DIGITS() -&amp;gt; 6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EOF() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EOF(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the specified logical file name and returns the Boolean value 1 (True), if the end-of-file has been reached, and 0 (False) otherwise. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EOF(infile) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ERRORTEXT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ERRORTEXT(n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the error message associated with the specified ARexx error code. The null string is returned if the number is not a valid error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY ERRORTEXT(41) -&amp;gt; Invalid expression &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXISTS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXISTS(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether an external file of the given filename exists. The name string may include device and directory specifications. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY EXISTS(&#039;SYS:C/ED&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EXPORT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXPORT(address[,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copies data from the optional string into a previously-allocated memory area. This memory area must be specified as a four-byte address. The length parameter specifies the maximum number of characters to be copied. The default is the length of the string. If the specified length is longer than the string, the remaining area is filled with the pad character or nulls (`00&#039;x). The returned value is the number of characters copied.&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
See also IMPORT() and STORAGE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
count = EXPORT(&#039;0004 0000&#039;x, &#039;The answer&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FIND() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FIND(string,phrase)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The FIND() function locates a phrase of words in a larger string of words and returns the word number of the matched position. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY FIND(&#039;Now is the time&#039;, &#039;is the&#039;) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FORM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FORM()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FORM setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FORM SCIENTIFIC&lt;br /&gt;
SAY FORM() -&amp;gt; SCIENTIFIC &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FREESPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREESPACE(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a block of memory of a given length to the interpreter&#039;s internal pool. The address argument must be a 4 byte string obtained by a prior call to GETSPACE(), the internal allocator. It is not always necessary to release internally allocated memory, since it will be released to the system when the program terminates. However, if a very large block has been allocated, returning it to the pool may avoid memory space problems. The return value is a Boolean success flag. See also GETSPACE().&lt;br /&gt;
&lt;br /&gt;
Calling FREESPACE() with no arguments will return the amount of memory available in the interpreter&#039;s internal pool. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FREESPACE(&#039;00042000&#039;x,32) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FUZZ() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FUZZ()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current NUMERIC FUZZ setting. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC FUZZ 3&lt;br /&gt;
SAY FUZZ() -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETCLIP() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETCLIP(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches the Clip List for an entry matching the supplied name parameter and returns the associated value string. The name matching is case-sensitive. The null string is returned if the name cannot be found. See also SETCLIP(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume &#039;numbers&#039; contains &#039;PI=3.14159&#039;*/&lt;br /&gt;
SAY GETCLIP(&#039;numbers&#039;) -&amp;gt; PI=3.14159 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GETSPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETSPACE(length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the interpreter&#039;s internal pool. The returned value is the four-byte address of the allocated block, which is not cleared or otherwise initialized. Internal memory is automatically returned to the system when the ARexx program terminates, so this function should not be used to allocate memory for use by external programs. The REXXSupport.Library includes the function ALLOCMEM(), which allocates memory from the system free list. See also FREESPACE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X (GETSPACE(32)) -&amp;gt; &#039;0003BF40&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HASH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;HASH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the hash attribute of a string as a decimal number and updates the internal hash value of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY HASH(&#039;1&#039;) -&amp;gt; 49&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMPORT() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IMPORT(address[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a string by copying data from the specified four-byte address. If the length parameter is not supplied, the copy terminates when a null byte is found. See also EXPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
extval = IMPORT(&#039;0004 0000&#039;x,8) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INDEX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INDEX(string,pattern[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default start position is 1. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;23&amp;quot;) -&amp;gt; 2&lt;br /&gt;
SAY INDEX(&amp;quot;123456&amp;quot;, &amp;quot;77&amp;quot;) -&amp;gt; 0&lt;br /&gt;
SAY INDEX(&amp;quot;123123&amp;quot;, &amp;quot;23&amp;quot;,3) -&amp;gt; 5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== INSERT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INSERT(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inserts the new string into the old string after the specified start position. The default starting position is 0. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY INSERT(&#039;ab&#039;, &#039;12345&#039;) -&amp;gt; ab12345&lt;br /&gt;
SAY INSERT(&#039;123&#039;, &#039;++&#039;,3,5, &#039;-&#039;) -&amp;gt; ++-123-- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LASTPOS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LASTPOS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches backwards for the first occurrence of the pattern argument in the string argument, beginning at the specified start position. The default starting position is the end of the string. The returned value is the index of the matched pattern or 0 if the pattern was not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;1234234&#039;) -&amp;gt; 5&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;123234&#039;,3) -&amp;gt; 2&lt;br /&gt;
SAY LASTPOS(&#039;2&#039;, &#039;13579&#039;) -&amp;gt; 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LEFT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEFT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the leftmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the right with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,3) -&amp;gt; 123&lt;br /&gt;
SAY LEFT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; 123456++&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LENGTH(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY LENGTH(&#039;three&#039;) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LINES() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LINES(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of lines queued or typed ahead at the logical file, which must refer to an interactive stream. The line count is obtained as the secondary result of a WaitForChar() call. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH &#039;a line&#039;&lt;br /&gt;
PUSH &#039;another one&#039;&lt;br /&gt;
SAY LINES(STDIN) -&amp;gt; 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MAX() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MAX(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the maximum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MAX(2.1,3,-1) -&amp;gt; 3 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MIN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;MIN(number,number[,number,...])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Returns the minimum of the supplied arguments, all of which must be numeric. At least two parameters must be supplied. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY MIN(2.1,3,-1) -&amp;gt; -1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OPEN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPEN(file,filename[,&#039;APPEND&#039;|&#039;READ&#039;|&#039;WRITE&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Opens an external file for the specified operation. The file argument defines the logical name by which the file will be referenced. The filename is the external name of he file and may include device and directory specifications. The function returns a Boolean value that indicates whether the operation was successful. There is no limit to the number of files that can be open simultaneously, and all open files are closed automatically when the program exits. See also CLOSE(), READ(), and WRITE(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OPEN(&#039;MyCon&#039;, &#039;CON:160/50/320/100/MyCON/cds&#039;) P-&amp;gt; 1&lt;br /&gt;
SAY OPEN(&#039;outfile&#039;, &#039;ram:temp&#039;, &#039;W&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OVERLAY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OVERLAY(new,old[,start][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Overlays the new string onto the old string beginning at the specified start position, which must be positive. The default starting position is 1. The new string is truncated or padded to the specified length as required, using the supplied pad character or blanks. If the start position is beyond the end of the old string, the old string is padded on the right. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY OVERLAY(&#039;bb&#039;, &#039;abcd&#039;) -&amp;gt; bbcd&lt;br /&gt;
SAY OVERLAY(&#039;4&#039;, &#039;123&#039;,5,5, &#039;-&#039;) -&amp;gt; 123-4---- &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== POS() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;POS(pattern,string[,start])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Searches for the first occurrence of the pattern argument in the string argument, beginning at the position specified by the start argument. The default starting position is 1. The value is the index of the matched string or 0 if the pattern wasn&#039;t found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;) -&amp;gt; 2&lt;br /&gt;
SAY POS(&#039;77&#039;, &#039;123234&#039;) -&amp;gt; 0&lt;br /&gt;
SAY POS(&#039;23&#039;, &#039;123234&#039;,3) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===  PRAGMA() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PRAGMA(option[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function allows a program to change various attributes relating to the system environment within which the program executes. The option argument is a keyword that specifies an environmental attribute. The value argument supplies the new attribute value to be installed. The value returned by the function depends on the attribute selected. Some attributes return the previous value installed, while others may simply set a Boolean success flag.&lt;br /&gt;
&lt;br /&gt;
The currently defined option keywords are:&lt;br /&gt;
&lt;br /&gt;
; DIRECTORY&lt;br /&gt;
: Specifies a new current directory. The current directory is used as the root for filenames that do not explicitly include a device specification. The return is the old directory name. PRAGMA(`D&#039;) is equivalent to PRAGMA(`D&#039;,&amp;quot;). It returns the path of the current directory without changing the directory.&lt;br /&gt;
&lt;br /&gt;
; PRIORITY&lt;br /&gt;
: Specifies a new task priority. The priority value must be an integer in the range - 128 to 127, but the practical range is much more limited. ARexx programs should never be run at a priority higher than that of the resident process, which currently runs at a priority of 4. The returned value is the previous priority level.&lt;br /&gt;
&lt;br /&gt;
; ID&lt;br /&gt;
: Returns the task ID (the address of the task block) as an 8-character hex string. The task ID is a unique identifier of the particular ARexx invocation and may be used to create a unique name for it.&lt;br /&gt;
&lt;br /&gt;
; STACK&lt;br /&gt;
: Specifies a new stack value for your current ARexx program. When a new stack value is declared, the previous stack value is returned.&lt;br /&gt;
&lt;br /&gt;
The currently implemented options are:&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;W&#039;,{&#039;NULL&#039;|&#039; WORKBENCH&#039;})&lt;br /&gt;
: Controls the task&#039;s WindowPtr field. Setting it to &#039;NULL&#039; will suppress any requesters that might otherwise be generated by a DOS call.&lt;br /&gt;
&lt;br /&gt;
; PRAGMA(&#039;*&#039;[,name])&lt;br /&gt;
: Defines the specified logical name as the current (&amp;quot;*&amp;quot;) console handler, allowing the user to open two streams on one window. If the name is omitted, the console handler is set to that of the client&#039;s process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF0:C&#039;) -&amp;gt; Extras&lt;br /&gt;
SAY PRAGMA(&#039;D&#039;, &#039;DF1:C&#039;) -&amp;gt; Workbench:C&lt;br /&gt;
SAY PRAGMA(&#039;PRIORITY&#039;, -5) -&amp;gt; 0&lt;br /&gt;
SAY PRAGMA(&#039;ID&#039;) -&amp;gt; 00221ABC&lt;br /&gt;
CALL PRAGMA &#039;*&#039;,STDOUT&lt;br /&gt;
SAY PRAGMA(&amp;quot;STACK&amp;quot;,8092) -&amp;gt; 4000 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDOM() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDOM([MIN][,MAX][,seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a pseudo-random integer in the interval specified by the min and max arguments. The default minimum value is 0 and the default maximum value is 999. The interval max-min must be less than or equal to 1000. If a greater range of random integers is required, the values from the RANDU() function can be suitably scaled and translated. The seed argument can be supplied to initialize the internal state of the random number generator. See also RANDU(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
thisroll = RANDOM(1,6) /*Might be 1*/&lt;br /&gt;
nextroll = RANDOM(1,6) /*Might be snake eyes*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RANDU() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RANDU([seed])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a uniformly-distributed, pseudo-random number between 0 and 1. The number of digits of precision in the result is always equal to the current Numeric Digits setting. With the choice of suitable scaling and translation values, RANDU() can be used to generate pseudo-random numbers on an arbitrary interval.&lt;br /&gt;
&lt;br /&gt;
The optional integer seed argument is used to initialize the internal state of the random number generator. See also RANDOM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
firsttry = RANDU() /*0.371902021?*/&lt;br /&gt;
NUMERIC DIGITS 3&lt;br /&gt;
tryagain = RANDU () /*0.873?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READCH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READCH(file,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads the specified number of characters from the given logical file into a string. The length of the returned string is the actual number of characters read and may be less than the requested length if, for example, the end-of-file was reached. See also READLN(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READCH(&#039;input&#039;,10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== READLN() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;READLN(file)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reads characters from the given logical file into a string until a newline character is found. The returned string does not include the newline. See also READCH(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
instring = READLN(&#039;MyFile&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REMLIB() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REMLIB(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes an entry with the given name from the Library List maintained by the resident process. The Boolean return is 1 if the entry was found and successfully removed. This function does not make a distinction between function libraries and function hosts, but simply removes a named entry. See also ADDLIB(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REMLIB(&#039;MyLibrary.library&#039;) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REVERSE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REVERSE(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reverses the sequence of characters in the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY REVERSE(&#039;?ton yhw&#039;) -&amp;gt; why not?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RIGHT() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RIGHT(string,length[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the rightmost substring in the given string argument with the specified length. If the substring is shorter than the requested length, it is padded on the left with the supplied pad character or blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,4) -&amp;gt; 3456&lt;br /&gt;
SAY RIGHT(&#039;123456&#039;,8, &#039;+&#039;) -&amp;gt; ++123456&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SEEK() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SEEK(file,offset[,&#039;BEHIN&#039;|&#039;CURRENT&#039;|&#039;END&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Moves to a new position in the given logical file, specified as an offset from an anchor position. The default anchor is Current. The returned value is the new position relative to the start of the file. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SEEK(&#039;input&#039;,10,&#039;B&#039;) -&amp;gt; 10&lt;br /&gt;
SAY SEEK(&#039;input&#039;,0,E&#039;) -&amp;gt; 356 /*file length*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SETCLIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SETCLIP(name[,value])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adds a name-value pair to the Clip List maintained by the resident process. If an entry of the same name already exists, its value is updated to the supplied value string. Entries may be removed by specifying a null value. The function returns a Boolean value that indicates whether the operation was successful. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;, &#039;DF0:s&#039;) -&amp;gt; 1&lt;br /&gt;
SAY SETCLIP(&#039;path&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SHOW() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOW(option[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the names in the resource list specified by the option argument, or tests to see whether an entry with the specified name is available. The currently implemented options keywords are:&lt;br /&gt;
&lt;br /&gt;
; CLIP&lt;br /&gt;
: Examines the names in the Clip List&lt;br /&gt;
&lt;br /&gt;
; FILES&lt;br /&gt;
: Examines the currently open logical file names&lt;br /&gt;
&lt;br /&gt;
; LIBRARIES&lt;br /&gt;
: Examines the names in the Library List, which are either function libraries or function hosts.&lt;br /&gt;
&lt;br /&gt;
; PORTS&lt;br /&gt;
: Examines the names in the system Ports List&lt;br /&gt;
&lt;br /&gt;
If the name argument is omitted, the function returns a string with the resource names separated by a blank space or the pad character, if one was supplied. If the name argument is given, the returned Boolean value indicates whether the name was found in the resource list. The name entries are case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== SIGN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGN(number)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns 1 if the number argument is positive or zero and -1 if the number is negative. The argument must be numeric. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SIGN(12) -&amp;gt; 1&lt;br /&gt;
SAY SIGN(-33) -&amp;gt; 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SOURCELINE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SOURCELINE([line])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the text for the specified line of the currently executing ARexx program. If the line argument is omitted, the function returns the total number of lines in the file. This function is often used to embed &amp;quot;help&amp;quot; information in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple test program*/&lt;br /&gt;
SAY SOURCELINE() -&amp;gt; 3&lt;br /&gt;
SAY SOURCELINE(1)-&amp;gt; /*A simple test program*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SPACE(string,n[,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reformats the string argument so that there are n spaces (blank characters) between each pair of words. If the pad character is specified, it is used instead of blanks as the separator character. Specifying n as 0 will remove all blanks from the string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,3) -&amp;gt; &#039;Now is the time&#039;&lt;br /&gt;
SAY SPACE(&#039;Now is the time&#039;,0) -&amp;gt; &#039;Nowisthetime&#039;&lt;br /&gt;
SAY SPACE(&#039;1 2 3&#039;,1, &#039;+&#039;) -&amp;gt; &#039;1+2+3&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STORAGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STORAGE([address][,string][,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STORAGE() with no arguments returns the available system memory. If the address argument is given, it must be a four-byte string. The function copies data from the (optional) string to the indicated memory address. The length parameter specifies the maximum number of bytes to be copied defaults to the length of the string. if the specified length is longer than the string, the remaining area is filled with the pad character or nulls (&#039;00&#039;x).&lt;br /&gt;
&lt;br /&gt;
The returned value is the previous contents of the memory area. This can be used in a subsequent call to restore the original contents. See also EXPORT().&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Any area of memory can be overwritten, possibly causing a system crash. Task switching is forbidden while the copy is being done, so system performance may be degraded if long strings are copied.}}&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STORAGE() -&amp;gt; &#039; 248400&lt;br /&gt;
oldval = STORAGE(&#039;0004 0000&#039;x, &#039;The answer&#039;)&lt;br /&gt;
CALL STORAGE &#039;0004 0000&#039;x,,32, &#039;+&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== STRIP() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STRIP(string[,{`B&#039; | `L&#039; | `T&#039;}][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If neither of the optional parameters is supplied, the function removes both leading and trailing blanks from the string argument. The second argument specifies whether Leading, Trailing or Both (leading and trailing) characters are to be removed. The optional pad (or unpad) argument selects the character to be removed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;) -&amp;gt; &#039;say What?&#039;&lt;br /&gt;
SAY STRIP(&#039; say what? &#039;,&#039;L&#039;) -&amp;gt; &#039;say what?&lt;br /&gt;
SAY STRIP(&#039;++123+++&#039;, &#039;B&#039;, &#039;+&#039;) -&amp;gt; &#039;123&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBSTR() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBSTR(string,start[,length][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning at the specified start position for the specified length. The starting position must be positive, and the default length is the remaining length of the string. If the substring is shorter than the requested length, it is padded on the right with the blanks or the specified pad character. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBSTR(&#039;123456&#039;,4,2) -&amp;gt; 45&lt;br /&gt;
SAY SUBSTR(&#039;myname&#039;,3,6, &#039;=&#039;) -&amp;gt; name==&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SUBWORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SUBWORD(string,n[,length])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the string argument beginning with the nth word for the specified length in words. The default length is the remaining length of the string. The returned string will never have leading or trailing blanks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SUBWORD(&#039;Now is the time &#039;,2,2) -&amp;gt; is the &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SYMBOL() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SYMBOL(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tests whether the name argument is a valid ARexx symbol. If the name is not a valid symbol, the function returns the string BAD. If the symbol is uninitialized, the returned string is LIT. If the symbol ha been assigned a value, VAR is returned. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SYMBOL(&#039;J&#039;) -&amp;gt; VAR&lt;br /&gt;
SAY SYMBOL(&#039;x&#039;) -&amp;gt; LIT&lt;br /&gt;
SAY SYMBOL(&#039;++&#039;) -&amp;gt; BAD &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TIME() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TIME(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the current system time or controls the internal elapsed time counter. The valid option keywords are:&lt;br /&gt;
&lt;br /&gt;
; CIVIL&lt;br /&gt;
: Current time in 12 hour format (a.m./p.m.) hours/minutes&lt;br /&gt;
&lt;br /&gt;
; ELAPSED&lt;br /&gt;
: Elapsed time in seconds since program start&lt;br /&gt;
&lt;br /&gt;
; HOURS&lt;br /&gt;
: Current time in hours since midnight&lt;br /&gt;
&lt;br /&gt;
; MINUTES&lt;br /&gt;
: Current time in minutes since midnight&lt;br /&gt;
&lt;br /&gt;
; NORMAL&lt;br /&gt;
: Current time in 24 hour format (hours/minutes/seconds)&lt;br /&gt;
&lt;br /&gt;
; RESET&lt;br /&gt;
: Reset the elapsed time clock&lt;br /&gt;
&lt;br /&gt;
; SECONDS&lt;br /&gt;
: Current time in seconds since midnight&lt;br /&gt;
&lt;br /&gt;
If no option is specified, the function returns the current system time in the form HH:MM:SS. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Suppose that the time is 1:02 AM . . .*/&lt;br /&gt;
SAY TIME(&#039;C&#039;( -&amp;gt; 1:02 AM&lt;br /&gt;
SAY TIME(&#039;HOURS&#039;) -&amp;gt; 1&lt;br /&gt;
SAY TIME(&#039;M&#039;) -&amp;gt; 62&lt;br /&gt;
SAY TIME(&#039;N&#039;) -&amp;gt; 01:02:54&lt;br /&gt;
SAY TIME(&#039;S&#039;) -&amp;gt; 3720&lt;br /&gt;
call TIME(&#039;R&#039;) /*reset timer*/&lt;br /&gt;
SAY TIME(&#039;E&#039;) -&amp;gt; .020&lt;br /&gt;
SAY TIME() -&amp;gt; 01:02:00 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRACE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRACE(option)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the tracing mode (see Chapter 6) to that specified by the option keyword, which must be one of the valid alphabetic or prefix options. The TRACE() function will alter the tracing mode even during interactive tracing, when TRACE instructions in the source program are ignored. The returned value is the mode in effect before the function call. This allows the previous trace mode to be restored later. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume tracing mode is ?ALL*/&lt;br /&gt;
SAY TRACE(&#039;Results&#039;) -&amp;gt; ?A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRANSLATE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRANSLATE(string[,output][,input][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function constructs a translation table and uses it to replace selected characters in the argument string. If only the string argument is given, it is translated to uppercase. If an input table is supplied, it modifies the translation table so that characters in the argument string that occur in the input table are replaced with the corresponding character in the output table. Characters beyond the end of the output table are replaced with the specified pad character or a blank. The result string is always for the same length as the original string. The input and output tables may be of any length. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRANSLATE(&amp;quot;abcde&amp;quot;, &amp;quot;123&amp;quot;, &amp;quot;cbade&amp;quot;, &amp;quot;+&amp;quot;) -&amp;gt; 321++&lt;br /&gt;
SAY TRANSLATE(&amp;quot;low&amp;quot;) -&amp;gt; LOW&lt;br /&gt;
SAY TRANSLATE(&amp;quot;0110&amp;quot;, &amp;quot;10&amp;quot;, &amp;quot;01&amp;quot;) -&amp;gt; 1001 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRIM() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRIM(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes trailing blanks from the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY length (TRIM(&#039; abc &#039;)) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TRUNC() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;TRUNC(number[,places])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the integer part of the number argument followed by the specified number of decimal places. The default number of decimal places is 0. The number is padded with zeroes as necessary. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY TRUNC(123.456) -&amp;gt; 123&lt;br /&gt;
SAY TRUNC(123.456,4) -&amp;gt; 123.4560 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UPPER() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;UPPER(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translate the string to uppercase. The action of this function is equivalent to that of TRANSLATE(string), but it is slightly faster for short strings. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY UPPER(&#039;One Fine Day&#039;) -&amp;gt; ONE FINE DAY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VALUE() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VALUE(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the value of the symbol represented by the name argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Assume that J has the value 12*/&lt;br /&gt;
SAY VALUE(&#039;j&#039;) -&amp;gt; 12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== VERIFY() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;VERIFY(string,list[,&#039;MATCH&#039;])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the index of the first character in the string argument which is not contained in the list argument or 0 if all of the characters are in the list. If the MATCH keyword is supplied, the function returns the index of the first character which is in the list or 0 if none of the characters are in the list. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY VERIFY(&#039;123456&#039;, &#039;0123456789&#039;) -&amp;gt; 0&lt;br /&gt;
SAY VERIFY(&#039;123a56&#039;, &#039;0123456789&#039;) -&amp;gt; 4&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;abcdefghij&#039;, &#039;m&#039;) -&amp;gt; 4 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORD() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORD(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the nth word in the string argument or the null string if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORD(&#039;Now is the time &#039;,2) -&amp;gt; is&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDINDEX() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDINDEX(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the starting position of the nth word in the argument string or 0 if there are fewer than n words. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDLENGTH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDLENGTH(string,n)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the length of the nth word in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDLENGTH(&#039;one two three&#039;,3) -&amp;gt; 5 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WORDS() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WORDS(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the number of words in the string argument. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WORDS(&amp;quot;You don&#039;t SAY!&amp;quot;) -&amp;gt; 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITECH() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITECH(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITECH(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 7 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== WRITELN() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WRITELN(file,string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Writes the string argument to the given logical file with a newline appended. The returned value is the actual number of characters written. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY WRITELN(&#039;output&#039;, &#039;Testing&#039;) -&amp;gt; 8&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2C() ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2C(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a string of hex digits into the (packed) character representation. Blank characters are permitted in the argument string at byte boundaries. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2C(&#039;12ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(&#039;12 ab&#039;) -&amp;gt; &#039;12ab&#039;x&lt;br /&gt;
SAY X2C(61) -&amp;gt; a &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== X2D() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;X2D(hex,digits)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Converts a hexadecimal number to decimal. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY X2D(&#039;1f&#039;) -&amp;gt; 31&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XRANGE() ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XRANGE([start][,end])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generates a string consisting of all characters numerically between the specified start and end values. The default start character is &#039;00&#039;x, and the default end character is &#039;FF&#039;x. Only the first character of the start and end arguments is significant. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY XRANGE() -&amp;gt; &#039;00010203 . . . FDFEFF&#039;x&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;f&#039;) -&amp;gt; &#039;abcdef&#039;&lt;br /&gt;
SAY XRANGE(,&#039;0A&#039;x) -&amp;gt; &#039;000102030405060708090A&#039;x &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Program ==&lt;br /&gt;
&lt;br /&gt;
The following example program illustrates many of the built-in functions that manipulate character strings.&lt;br /&gt;
&lt;br /&gt;
=== Program 13. Changestrings.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This ARexx program shows the effect of built-in functions that change strings. The functions come in two groups: one that manipulates individual characters and one that manipulates whole strings.*/&lt;br /&gt;
&lt;br /&gt;
teststring1 = &amp;quot; every good boy does fine &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The first group is composed of the functions STRIP(), COMPRESS(), SPACE(), TRIM(), TRANSLATE(), DELSTR(), DELWORD(), INSERT(), OVERLAY(), and REVERSE().*/&lt;br /&gt;
&lt;br /&gt;
/*STRIP() removes only leading and trailing characters.*/&lt;br /&gt;
&lt;br /&gt;
/*Print the original string, for comparison. We put a period at the end of the string, so you can see what happens to the spaces at the end of the string.*/&lt;br /&gt;
SAY &amp;quot; every  good   boy   does   fine   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The same string stripped of leading and trailing spaces*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Failed attempt to remove leading and trailing &amp;quot;e&amp;quot;s*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*The &amp;quot;e&amp;quot;&#039;s were protected by the leading and trailing spaces. Removing them exposes the &amp;quot;e&amp;quot;&#039;s to the effects of STRIP()*/&lt;br /&gt;
SAY STRIP(&amp;quot;every good boy does fine&amp;quot;,,&amp;quot;e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove &amp;quot;e&amp;quot;&#039;s and spaces from the original string*/&lt;br /&gt;
SAY STRIP(&amp;quot; every good boy does fine &amp;quot;,,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*We are now using the variable &amp;quot;teststring1&amp;quot;, defined above. Remove only the trailing spaces in the test string.*/&lt;br /&gt;
SAY STRIP(teststring1, T)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Remove the trailing spaces and the &amp;quot;e&amp;quot;*/&lt;br /&gt;
SAY STRIP(teststring1,T,&amp;quot; e&amp;quot;)&amp;quot;.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/*Compress() removes characters anywhere in the string. This removes all blanks from the test string*/&lt;br /&gt;
SAY COMPRESS(teststring1)&lt;br /&gt;
&lt;br /&gt;
CALL TIME(&#039;r&#039;)&lt;br /&gt;
SAY TIME(&#039;Civil&#039;) /*Civilian time HH:MM{AM | PM}*/&lt;br /&gt;
SAY TIME(&#039;h&#039;) /*Hours since midnight*/&lt;br /&gt;
SAY TIME(&#039;m&#039;) /*Minutes since midnight*/&lt;br /&gt;
SAY TIME(&#039;s&#039;) /*Seconds since midnight*/&lt;br /&gt;
SAY TIME(&#039;e&#039;) /*Elapsed time since program start*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRACE Usage: TRACE( [option] )*/&lt;br /&gt;
SAY TRACE()&lt;br /&gt;
SAY TRACE(TRACE()) /*Leave it unchanged*/&lt;br /&gt;
&lt;br /&gt;
/*Function:TRANSLATE Usage: TRANSLATE(string[,output][,input] [,pad])*/&lt;br /&gt;
SAY TRANSLATE(&#039;aBCdef&#039;) /*Translate to Uppercase*/&lt;br /&gt;
SAY TRANSLATE (&#039;abcdef&#039;, &#039;1234&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;654321&#039;, &#039;abcdef&#039;, &#039;123456&#039;)&lt;br /&gt;
SAY TRANSLATE(&#039;abcdef&#039;, &#039;123&#039;, &#039;abcdef&#039;, &#039;+&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRIM Usage: TRIM(string)*/&lt;br /&gt;
SAY TRIM(&#039; abc &#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: TRUNC Usage: TRUNC(number[,places])*/&lt;br /&gt;
SAY TRUNC(123.456)&lt;br /&gt;
SAY &#039;$&#039;TRUNC(134566.123,2)&lt;br /&gt;
&lt;br /&gt;
/*Function: UPPER Usage: UPPER(string)*/&lt;br /&gt;
SAY UPPER(&#039;aBCdef12&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VALUE Usage: VALUE(name)*/&lt;br /&gt;
abc = &#039;my name&#039;&lt;br /&gt;
SAY VALUE(&#039;abc&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: VERIFY Usage: VERIFY(string,list[,&#039;M&#039;])*/&lt;br /&gt;
SAY VERIFY(&#039;123a45&#039;, &#039;0123456789&#039;)&lt;br /&gt;
SAY VERIFY(&#039;abc3de&#039;, &#039;012456789&#039;, &#039;M&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORD Usage: OWRD(string,n)*/&lt;br /&gt;
SAY WORD(&#039;Now is the time&#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDINDEX Usage: WORDINDEX(string,n)*/&lt;br /&gt;
SAY WORDINDEX(&#039;Now is the time &#039;,3)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDLENGTH Usage: WORDLENGTH(string,n)*/&lt;br /&gt;
SAY WORDLENGTH(&#039;Now is the time &#039;,4)&lt;br /&gt;
&lt;br /&gt;
/*Function: WORDS Usage: WORDS(string)*/&lt;br /&gt;
SAY WORDS(&#039;Now is the time&#039;)&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITECH Usage: WRITECH(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;,&#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITECH(&#039;test&#039;, &#039;message&#039;) /*Write the string*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: WRITELN Usage: WRITELN(logical,string)*/&lt;br /&gt;
IF OPEN(&#039;test&#039;, &#039;ram:test$$&#039;, &#039;W&#039;) THEN DO&lt;br /&gt;
   SAY WRITELN(&#039;test&#039;, &#039;message&#039;)&lt;br /&gt;
   /*Write the string (with newline)*/&lt;br /&gt;
   CALL CLOSE &#039;test&#039;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Function: X2C Usage: X2C(heystring)*/&lt;br /&gt;
SAY X2C(&#039;616263&#039;) /*Convent to character (pack)*/&lt;br /&gt;
&lt;br /&gt;
/*Function: XRANGE Usage: XRANGE([start] [,end])*/&lt;br /&gt;
SAY C2X(xrange(&#039;f0&#039;x))&lt;br /&gt;
SAY XRANGE(&#039;a&#039;, &#039;g&#039;)&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of Program 13 is:&lt;br /&gt;
&lt;br /&gt;
 every good boy does fine&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fine .&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 very good boy does fin.&lt;br /&gt;
 every good boy does fine.&lt;br /&gt;
 every good boy does fin.&lt;br /&gt;
 everygoodboydoesfine&lt;br /&gt;
 1:23PM /*These results vary depending*/&lt;br /&gt;
 13 /*on the time the program is run.*/&lt;br /&gt;
 803&lt;br /&gt;
 48199&lt;br /&gt;
 0.80&lt;br /&gt;
 N&lt;br /&gt;
 N&lt;br /&gt;
 ABCDEF&lt;br /&gt;
 abcdef&lt;br /&gt;
 fedcba&lt;br /&gt;
 123+++&lt;br /&gt;
 abc&lt;br /&gt;
 123&lt;br /&gt;
 $134566.12&lt;br /&gt;
 ABCDEF12&lt;br /&gt;
 my name&lt;br /&gt;
 4&lt;br /&gt;
 0&lt;br /&gt;
 the&lt;br /&gt;
 8&lt;br /&gt;
 4&lt;br /&gt;
 4&lt;br /&gt;
 7&lt;br /&gt;
 8&lt;br /&gt;
 abc&lt;br /&gt;
 F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF&lt;br /&gt;
 abcdefg&lt;br /&gt;
&lt;br /&gt;
= REXXSupport.Library Functions =&lt;br /&gt;
&lt;br /&gt;
The functions listed in this section are part of the REXXSupport.library. They may only be used if this library has been opened. Below is an example that shows you how to open this library.&lt;br /&gt;
&lt;br /&gt;
== Program 14. OpenLibrary.rexx ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Add rexxsupport.library if it isn&#039;t already open.*/&lt;br /&gt;
IF ~ SHOW (&#039;L&#039;, &amp;quot;rexxsupport.library&amp;quot;) THEN DO&lt;br /&gt;
/*If the library isn&#039;t open, try to open it*/&lt;br /&gt;
IF ADDLIB(&#039;rexxsupport.library&#039;, 0, -30,0)&lt;br /&gt;
THEN SAY &amp;quot;Added rexxsupport.library.&amp;quot;&lt;br /&gt;
ELSE DO&lt;br /&gt;
   SAY &#039;ARexx support library not available, exiting&#039;&lt;br /&gt;
   EXIT 10 /*Exit if ADDLIB() failed*/&lt;br /&gt;
   END&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ALLOCMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ALLOCMEM(length[,attribute])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allocates a block of memory of the specified length from the system free-memory pool and returns its address as a four-byte string. The optional attribute parameter must be a standard EXEC memory allocation flag, supplied as a four-byte string. The default attribute is for &amp;quot;PUBLIC&amp;quot; memory (not cleared). Refer to [[Exec_Memory_Allocation|Exec Memory Allocation]] for information on memory types and attribute parameters.&lt;br /&gt;
&lt;br /&gt;
This function should be used whenever memory is allocated for use by external programs. It is the user&#039;s responsibility to release the memory space when it is no longer needed. See also FREEMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY C2X(ALLOCMEM(1000)) -&amp;gt; 00050000&lt;br /&gt;
SAY C2X(ALLOCMEM (1000, &#039;00 01 00 0 1&#039;X)) -&amp;gt; 00228400&lt;br /&gt;
/*1000 bytes of CLEAR Public memory*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CLOSEPORT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CLOSEPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the message port specified by the name argument, which must have been allocated by a call to OPENPORT() within the current ARexx program. Any messages received but not yet REPLYed are automatically returned with the return code set to 10. See also OPENPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CLOSEPORT myport &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FREEMEM() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;FREEMEM(address,length)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Releases a block of memory of the given length to the system free list. The address parameter is a four-byte string, typically obtained by a prior call to ALLOCMEM(). FREEMEM() cannot be used to release memory allocated using GETSPACE(), the ARexx internal memory allocator. The returned value is a Boolean success flag. See also ALLOCMEM(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
MemoryRequest = 1024&lt;br /&gt;
MyMem = ALLOCMEM(MemoryRequest)&lt;br /&gt;
SAY C2X(MyMem) -&amp;gt; 07C987B0&lt;br /&gt;
SAY FREEMEM(MyMem, MemoryRequest) -&amp;gt; 1&lt;br /&gt;
/*Or: SAY FREEMEM(&#039;07C987B0&#039;x,1024)*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|title=Caution|text=Before your program terminates, you must use a matching FREEMEM() to release the exact amount of memory you allocated with each ALLOCMEM(). Otherwise, you may crash the system or leave memory unavailable until you reboot.}}&lt;br /&gt;
&lt;br /&gt;
== GETARG() ==  	&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETARG(packet[,n])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extracts a command, function name, or argument string from a message packet. The packet argument must be a four-byte address obtained from a prior call to GETPKT(). The optional [n] argument specifies the slot containing the string to be extracted and must be less than or equal to the actual argument count for the packet. Commands and function names are always in slot 0. Function packets my have argument strings in slots 1-15. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
command = GETARG(packet)&lt;br /&gt;
function = GETARG(packet,0) /*name string*/&lt;br /&gt;
arg1 = GETARG(packet,1) /*1st argument*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GETPKT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;GETPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks the message port specified by the name argument to see whether any messages are available. The named message port must have been opened by a prior call to OPENPRT() within the current ARexx program. The returned value is the four-byte address of the first message packet, or &#039;0000 0000&#039;x if no packets were available.&lt;br /&gt;
&lt;br /&gt;
The function returns immediately whether or not a packet is enqueued at the message port. Programs should never be designed to &amp;quot;busy-loop&amp;quot; on a message port. If there is no useful work to be done until the next message packet arrives, the program should call WAITPKT() and allow other tasks to proceed. See also WAITPKT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
packet = GETPKT (&#039;MyPort&#039;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPENPORT() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPENPORT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates a public message port with the given name. The returned Boolean value indicates whether the port was successfully opened. An initialization failure will occur if another port of the same name already exists or if a signal bit couldn&#039;t be allocated. The message port is allocated as a Port Resource node and is linked into the program&#039;s global data structure. Ports are automatically closed when the program exits and any pending messages are returned to the sender. See also CLOSEPORT(). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
success = OPENPORT(&amp;quot;MyPort&amp;quot;) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== REPLY() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;REPLY(packet,rc)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a message packet to the sender, with the primary result field set to the value given by the rc argument. The secondary result is cleared. The packet argument must be supplied as a four-byte address, and the rc argument must be a whole number. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL REPLY(packet,10) /*Error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWDIR() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWDIR(directory[,&#039;ALL&#039;|&#039;FILE&#039;|&#039;DIR&#039;][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the contents of the specified directory as a string of names separated by blanks. The second parameter is an option keyword that selects whether all entries, only files, or only subdirectories, will be included. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWDIR(&#039;SYS:REXXC&#039;, &#039;f&#039;, &#039;;&#039;) -&amp;gt; WaitForPort;TS;TE;TCO;RXSET;RXLIB;RXC;RX;HI&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHOWLIST() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHOWLIST({`A&#039; | `D&#039; | `H&#039; | `T&#039; | `L&#039; | `M&#039; | `P&#039; | `R&#039; | `S&#039; | `T&#039; | `V&#039; | `W&#039;}[,name][,pad])&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An argument is entered using its initial letter. The arguments are:&lt;br /&gt;
&lt;br /&gt;
; A&lt;br /&gt;
: ASSIGNS and Assigned Device&lt;br /&gt;
&lt;br /&gt;
; D&lt;br /&gt;
: Device Drivers&lt;br /&gt;
&lt;br /&gt;
; H&lt;br /&gt;
: Handlers&lt;br /&gt;
&lt;br /&gt;
; I&lt;br /&gt;
: Interrupts&lt;br /&gt;
&lt;br /&gt;
; L&lt;br /&gt;
: Libraries&lt;br /&gt;
&lt;br /&gt;
; M&lt;br /&gt;
: Memory List Items&lt;br /&gt;
&lt;br /&gt;
; P&lt;br /&gt;
: Ports&lt;br /&gt;
&lt;br /&gt;
; R&lt;br /&gt;
: Resources&lt;br /&gt;
&lt;br /&gt;
; S&lt;br /&gt;
: Semaphores&lt;br /&gt;
&lt;br /&gt;
; T&lt;br /&gt;
: Tasks (Ready)&lt;br /&gt;
&lt;br /&gt;
; V&lt;br /&gt;
: Volume Names&lt;br /&gt;
&lt;br /&gt;
; W&lt;br /&gt;
: Waiting Tasks&lt;br /&gt;
&lt;br /&gt;
If only one argument is supplied, SHOWLIST() returns a string separated by blanks: If a pad character is supplied, names will be separated by the pad rather than by blanks. If the name parameter is supplied. SHOWLIST() returns a Boolean value which indicates if the specified list contains that name. Names are case-sensitive. To provide an accurate snapshot of the current list, task switching is forbidden when the list is scanned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;) -&amp;gt; REXX MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;,,&#039;;&#039;) -&amp;gt; REXX;MyCon&lt;br /&gt;
SAY SHOWLIST(&#039;P&#039;, &#039;REXX&#039;) -&amp;gt; 1 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STATEF() ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;STATEF(filename)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns a string containing information about an external file. The string is formatted as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;quot;{DIR | FILE} length blocks protection days minutes ticks comment.&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length token gives the file length in bytes, and the block token specifies the file length in blocks. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY STATEF(&amp;quot;LIBS:REXXSupport.library&amp;quot;)&lt;br /&gt;
/*might give &amp;quot;File 2524 5 ----RW-D 4866 817 2088*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WAITPKT() ==&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WAITPKT(name)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waits for a message to be received at the specified (named) port, which must have been opened by a call to OPENPORT() within the current ARexx program. The returned Boolean value indicates whether a message packet is available at the port. Normally the returned value will be 1 (True), since the function waits until an event occurs at the message port.&lt;br /&gt;
&lt;br /&gt;
The packet must then be removed by a call to GETPKT() and should be returned eventually using the REPLY() function. Any message packets received but not returned when an ARexx program exits are automatically REPLYed with the return code set to 10. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL WAITPKT &#039;MyPort&#039; /*Wait awhile*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6857</id>
		<title>AmigaOS Manual: ARexx Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6857"/>
		<updated>2014-01-26T10:41:20Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: More typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An instruction clause begins with the name of a particular instruction and tells ARexx to perform a certain action. This chapter provides an alphabetical list of the instructions available in ARexx.&lt;br /&gt;
&lt;br /&gt;
Each instruction keyword may be followed by one or more subkeywords, expressions, or other instruction-specific information. Instruction keywords and subkeywords are recognized only in this specific context. This allows the same keywords to be used in a different context as variables or function names. An instruction keyword cannot be followed by a colon (:) or an equals (=) operator.&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&lt;br /&gt;
The syntax for each instruction is shown to the right of the keyword heading. The conventions used in the syntax are shown in Table 4-1:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 4-1. Syntax Conventions&lt;br /&gt;
! Convention !! Definition&lt;br /&gt;
|-&lt;br /&gt;
| KEYWORD || All keywords and subkeywords are shown in upper case letters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; (vertical bar) || Alternative selections are separated by a vertical bar&lt;br /&gt;
|-&lt;br /&gt;
| { } (braces) || Required alternatives are enclosed by braces&lt;br /&gt;
|-&lt;br /&gt;
| [ ] (brackets) || Optional instruction parts are enclosed in brackets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|The syntax conventions do not apply to the specifications following the keyword heading. They only apply to the syntax shown to the right of the instruction keyword.}}&lt;br /&gt;
&lt;br /&gt;
For example, the format for the CALL instruction is:&lt;br /&gt;
&lt;br /&gt;
 CALL {symbol | string} [expression] [,expression,...]&lt;br /&gt;
&lt;br /&gt;
You must supply a symbol or a string as an argument. The vertical bar identifies the alternative selections, and the braces indicate that the use of an argument is required. The specification of an expression is optional, as indicated by the brackets.&lt;br /&gt;
&lt;br /&gt;
Examples are given at the end of the instruction specification. Explanations or evaluations of the examples are shown as ARexx comments /*...*/.&lt;br /&gt;
&lt;br /&gt;
= Alphabetical Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of ARexx&#039;s built-in instructions. The syntax of each instruction is shown to the right of the instruction keyword.&lt;br /&gt;
&lt;br /&gt;
== ADDRESS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS [[symbol | string] | [VALUE][expressions]] &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction specifies a host address for commands issued by the interpreter. A host address is the name of an application&#039;s message port to which ARexx commands are sent. ARexx maintains two host addresses: a current and a previous value. Whenever a new host address is supplied, the previous address is lost and the current address becomes the previous one. These host addresses are part of a program&#039;s storage environment and are preserved across internal function calls. The current address can be retrieved with the built-in function ADDRESS().&lt;br /&gt;
&lt;br /&gt;
The ADDRESS keyword alone interchanges the current and previous hosts. Repeated execution will toggle between the two host addresses.&lt;br /&gt;
&lt;br /&gt;
ADDRESS {string | symbol]} specifies that the new host address is the string or symbol. The value of the string or symbol is the token itself. Message port names are case-sensitive. The appropriate syntax for a program command to a message port named MyPort is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS &#039;MyPort&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you omit the single quotes around MyPort, ARexx will look for the message port MYPORT and generate an error. The current host address becomes the previous address. An expression specified after a string or symbol is evaluated and the result is issued to the specified host. No changes are made to the current or previous address strings. This provides a convenient way to issue a single command to an external host without disturbing the current host addresses. The return code from the command is treated as it would be from a command clause.&lt;br /&gt;
&lt;br /&gt;
If ADDRESS [VALUE] expression is specified. ARexx uses the result of the expression as the new host address, and the current address becomes the previous address. The VALUE keyword may be omitted if the first token of the expression is not a symbol or string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS /*Swap current and previous address.*/&lt;br /&gt;
ADDRESS edit /*The new host address is EDIT.*/&lt;br /&gt;
ADDRESS edit &#039;top&#039; /*Move to the top.*/&lt;br /&gt;
ADDRESS VALUE edit in /*Compute a new host address.*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ARG ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG is a shorthand form for the PARSE UPPER ARG instruction. It retrieves one or more of the argument strings available to the program and assigns values to the variables in the template. The number of argument strings available depends on whether the program was invoked as a command or a function. Command invocations normally have only one argument string, but functions may have up to 15. The argument strings are not altered by the ARG instruction. ARG returns upper case letters. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARG first,second /*Retrieve arguments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure and processing of templates is described briefly with the PARSE instruction.&lt;br /&gt;
&lt;br /&gt;
== BREAK ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BREAK&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The BREAK instruction is used to exit from the range of a DO instruction or from within an INTERPRETed string. It is valid only in these contexts. If used within a DO statement, BREAK exits from the innermost DO statement containing the BREAK. This contrasts with the similar LEAVE instruction, which exits only from an iterative (repeating) DO. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO /*Begin block*/&lt;br /&gt;
 IF i&amp;gt;3 THEN BREAK /*Finished?*/&lt;br /&gt;
 a = a + 1&lt;br /&gt;
 y.a = name&lt;br /&gt;
 END /*End block*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CALL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CALL {symbol | string} [expressions] [,expression, ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CALL instruction is used to invoke an internal or external function. The function name is specified by the symbol or string token. Any expressions that follow are evaluated and become the arguments to the called function. The value returned by the function is assigned to the special variable RESULT. It is not an error if a result string is not returned. In this case the variable RESULT is DROPped (becomes uninitialized).&lt;br /&gt;
&lt;br /&gt;
The linkage to the function is established dynamically at the time of the call. ARexx follows a specific search order in attempting to locate the called function. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CENTER name, length+4, &#039;+&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CENTER is the called function. The expressions will be evaluated and passed as arguments to CENTER.&lt;br /&gt;
&lt;br /&gt;
== DO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DO [[var=exp] | [exp] [TO exp] [BY exp]] [FOR exp] [FOREVER] [WHILE exp | UNTIL exp]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction begins a group of instructions executed as a block. The range of the DO instruction includes all statements up to and including an eventual END instruction.&lt;br /&gt;
&lt;br /&gt;
If no subkeywords follow the DO instruction, the block is executed once. Subkeywords can be used to iterate the block until a termination condition occurs. An interative DO instruction is sometimes called a loop since ARexx &amp;quot;loops back&amp;quot; to perform the instruction repeatedly. The various parts of the DO instruction are:&lt;br /&gt;
&lt;br /&gt;
* An initializer expression of the form &amp;quot;variable=expression&amp;quot; defines the index variable of the loop. The expression is evaluated when the DO range is first activated and the result is assigned to the index variable. On subsequent iterations an expression of the form &amp;quot;variable = variable + increment&amp;quot; is evaluated, where the increment is the result of the BY expression. If specified, the initializer expression must precede any of the other subkeywords.&lt;br /&gt;
&lt;br /&gt;
* The expression following a BY symbol defines the increment to be added to the index variable in each subsequent iteration. The expression must yield a numeric result, which may be positive or negative and need not be an integer. The default increment is 1.&lt;br /&gt;
&lt;br /&gt;
* The result of the TO expression specifies the upper (or lower) limit for the index variable. At each iteration the index variable is compared to the TO result. If the increment (BY result) is positive and the variable is greater than the limit, the DO instruction terminates and control passes to the statement following the END instruction. The loop also terminates if the increment is negative and the index variable is less than the limit.&lt;br /&gt;
&lt;br /&gt;
* The FOR expression must yield a positive whole number when evaluated and specifies the maximum number of iterations to be performed. The loop terminates when this limit is reached, irrespective of the value of the index variable.&lt;br /&gt;
&lt;br /&gt;
* The initializer BY, TO and FOR expressions are evaluated only when the instruction is first activated, so the increment and limits are fixed through the execution. A limit is not required. For example, the instruction &amp;quot;DO i=1&amp;quot; will simply count away forever.&lt;br /&gt;
&lt;br /&gt;
* The FOREVER keyword can be used if an iterative DO instruction is required but no index variable is necessary. The loop will be terminated by a LEAVE or BREAK instruction contained within the loop.&lt;br /&gt;
&lt;br /&gt;
* The WHILE expression is evaluated at the beginning of each iteration and must result in a Boolean value. The iteration proceeds if the result is 1 (true); otherwise, the loop terminates.&lt;br /&gt;
&lt;br /&gt;
* The UNTIL expression is evaluated at the end of each iteration and must result in a Boolean value. The instruction continues with the next iteration if the result is 0 (false), and terminates otherwise. (WHILE and UNTIL are mutually exclusive.)&lt;br /&gt;
&lt;br /&gt;
=== Program 12. Iteration.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Examples of DO*/&lt;br /&gt;
LIMIT = 20; number = 1&lt;br /&gt;
DO i=1 to LIMIT for 10 WHILE number &amp;lt; 20&lt;br /&gt;
   number = i * number&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
number = number/3.345; i = 0&lt;br /&gt;
DO number for LIMIT/5&lt;br /&gt;
   i = i + 1&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is shown with comment lines for explanation. The comments would not appear on your screen.&lt;br /&gt;
&lt;br /&gt;
 Iteration 1 number = 1 /*1 * 1 = 1*/&lt;br /&gt;
 Iteration 2 number = 2 /*2 * 1 = 2*/&lt;br /&gt;
 Iteration 3 number = 6 /*3 * 2 = 6*/&lt;br /&gt;
 Iteration 4 number = 24 /*4 * 6 = 24*/&lt;br /&gt;
 Iteration 1 number = 7.17488789 /*24/3.345 = 7.17488789*/&lt;br /&gt;
 Iteration 2 number = 7.17488789 /*number doesn&#039;t change*/&lt;br /&gt;
 Iteration 3 number = 7.17488789 /*limit/5 = 20/5 = 4*/&lt;br /&gt;
 Iteration 4 number = 7.17488789 /*operation repeats 4 times*/&lt;br /&gt;
&lt;br /&gt;
{{Note|If a FOR limit is also present, the initial expression is still evaluated, but the result need not be a positive integer.}}&lt;br /&gt;
&lt;br /&gt;
== DROP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DROP variable [variable ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The specified variable symbols are reset to their unintialized state, in which the value of the variable is the variable name itself. It is not an error to DROP a variable that is already uninitialized. DROPping a stem symbol is equivalent to DROPping the values of all possible compound symbols derived from the stem. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
a = 123 /*Assign a value to a */&lt;br /&gt;
DROP a b /*DROP (remove) the values from A and B*/&lt;br /&gt;
SAY a b /*Results in A B.*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ECHO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ECHO [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ECHO instruction is a synonym for the SAY instruction. It displays the expression result on the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ECHO &amp;quot;you don&#039;t say&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ELSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ELSE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ELSE instruction provides the alternative conditional branch for an IF statement. It is valid only within the range of an IF instruction and must follow the conditional statement of the THEN branch. If the THEN branch isn&#039;t executed, the statement following the ELSE clause is performed.&lt;br /&gt;
&lt;br /&gt;
ELSE clauses always bind to the nearest, preceding IF statement. It may be necessary to provide &amp;quot;dummy&amp;quot; ELSE clauses for the inner IF ranges of a compound IF statement to allow alternative branches for the outer IF statements. It is not sufficient to follow the ELSE with a semicolon or a null clause. Instead, the NOP (no-operation) instruction can be used. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i &amp;gt; 2 THEN SAY &#039;Really?&#039;&lt;br /&gt;
ELSE SAY &#039;I thought so&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== END ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;END [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The END instruction terminates the range of a DO or SELECT instruction. If the optional variable symbol is supplied, it is compared to the index variable of the DO statement (which must be iterative). An error is generated if the symbols do not match. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5 /*Index variable is i*/&lt;br /&gt;
   SAY i&lt;br /&gt;
   END i /*End &amp;quot;i&amp;quot; loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EXIT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXIT [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The EXIT instruction terminates the execution of a program. It is valid anywhere within a program. The evaluated expression is passed back to the caller as the function or command result.&lt;br /&gt;
&lt;br /&gt;
The processing of the EXIT result depends on whether a result string was requested by the calling program and whether the current invocation resulted from a command or function call.&lt;br /&gt;
&lt;br /&gt;
* If a result string was requested, the expression result is copied to a block of allocated memory and a pointer to the block is returned as the secondary result of the call.&lt;br /&gt;
&lt;br /&gt;
* If the caller did not request a result string and the program was invoked as a command, an attempt is made to convert the expression result to an integer. This value is then returned as the primary result, with 0 as the secondary result. This allows the EXIT information to be interpreted as a return code by the caller.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
EXIT /*No result needed*/&lt;br /&gt;
EXIT 10 /*An error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IF ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IF expression [THEN] [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF instruction is used in conjunction with THEN and ELSE instructions to conditionally execute a statement. The result of the expression must be a Boolean value. If the result is 1 (True), the statement following the THEN symbol is executed. Otherwise, control passes to the next statement. The THEN keyword need not immediately follow the IF expression, but may appear as a separate clause.&lt;br /&gt;
&lt;br /&gt;
The instruction is analyzed as &amp;quot;IF expression; THEN; statement&amp;quot;. The expression following the IF statement establishes the test condition that determines whether subsequent THEN or ELSE clauses will be performed. Any valid statement may follow the THEN symbol. In particular, a &amp;quot;DO ... END;&amp;quot; group allows a series of statements to be performed conditionally. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF result &amp;lt; 0 THEN exit /*All done?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INTERPRET ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INTERPRET expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The INTERPRET command treats the expression as though it were a source statement block. The expression is evaluated and the result is executed as one or more program statements. The statements are considered as a group, as if surrounded by a &amp;quot;DO ... END&amp;quot; combination. Any statements can be included in the INTERPRETed source, including DO or SELECT instructions. The BREAK instruction can be used to terminate the processing of INTERPRETed statements.&lt;br /&gt;
&lt;br /&gt;
An INTERPRET instruction activates a control range when it is executed, which serves as a boundary for LEAVE and ITERATE instructions. These instructions can only be used with DO loops defined within the INTERPRET. While it is not an error to include label clauses within the interpreted string, only those labels defined in the original program are searched during a transfer of control.&lt;br /&gt;
&lt;br /&gt;
The INTERPRET instruction can be used to construct programs dynamically and then execute them. Program fragments may be passed as arguments to functions, which then INTERPRET the fragments. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
inst = `SAY&#039; /*An instruction*/&lt;br /&gt;
INTERPRET inst hello /*. . . &amp;quot;SAY HELLO&amp;quot;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ITERATE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ITERATE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ITERATE instruction terminates the current iteration of a DO instruction and begins the next iteration. Effectively, control passes to the END statement and then (depending on the outcome of the UNTIL expression) back to the DO statement. The instruction normally acts on the innermost iterative DO range. An error results if the ITERATE instruction is not contained within an iterative DO instruction.&lt;br /&gt;
&lt;br /&gt;
If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   IF i = 3 THEN ITERATE i&lt;br /&gt;
   SAY i&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LEAVE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEAVE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LEAVE forces an immediate exit from the iterative DO range containing the instruction. An error results if the LEAVE instruction is not contained within an iterative DO instruction. If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i = 1 to limit&lt;br /&gt;
   IF i &amp;gt; 5 THEN LEAVE /*Maximum iterations*/&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NOP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NOP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The NOP (NO-oPeration) instruction is provided to control the binding of ELSE clauses in compound IF statements. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i = j THEN           /*First (outer) IF*/&lt;br /&gt;
   IF j = k THEN a = 0  /*Inner IF*/&lt;br /&gt;
      ELSE NOP          /*Binds to inner IF*/&lt;br /&gt;
   ELSE a = a + 1       /*Binds to outer IF*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NUMERIC ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NUMERIC {DIGITS | FUZZ} expression NUMERIC FORM {SCIENTIFIC | ENGINEERING}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The NUMERIC instruction sets options relating to numeric precision and format. The numeric options are preserved when an internal function is called.&lt;br /&gt;
&lt;br /&gt;
* The DIGITS expression option specifies the number of digits of precision for arithmetic calculations. The expression must evaluate to a positive whole number.&lt;br /&gt;
&lt;br /&gt;
* The FUZZ expression option specifies the number of digits to be ignored in numeric comparison operations. This must be a positive whole number, less than the current DIGITS setting.&lt;br /&gt;
&lt;br /&gt;
* The FORM SCIENTIFIC option specifies that numbers that require exponential notation be expressed in scientific notation. The exponent is adjusted so that the mantissa for non-zero number is between 1 and 10. This is the default format.&lt;br /&gt;
&lt;br /&gt;
* The FORM ENGINEERING option selects engineering format for numbers that require exponential notation. Engineering format normalizes a number so that its exponent is a multiple of three and the mantissa (if not 0) is between 1 and 1000.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 12 /*12 digits of precision*/&lt;br /&gt;
NUMERIC FORM SCIENTIFIC /*Result in scientific notation*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPTIONS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [FAILAT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [PROMPT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [RESULTS]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [CACHE]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The OPTIONS instruction is used to set various internal defaults. The FAILAT expression sets the limit at or above which command return codes will be signaled as errors. It must evaluate to an integer value. The PROMPT expression provides a string to be used as the prompt with the PULL (or PARSE PULL) instruction. The RESULTS keyword indicates that the interpreter should request a result string when it issues commands to an external host.&lt;br /&gt;
&lt;br /&gt;
The internal options controlled by this instruction are preserved across function calls, so an OPTIONS instruction can be issued within an internal function without affecting the caller&#039;s environment. If no keyword is specified with the OPTIONS instruction, all controlled options revert to their default settings. The OPTIONS instruction also accepts a NO keyword to reset a selected option to its default value, making it more convenient to reset the RESULTS attribute for a single command without having to reset the FAILAT and PROMPT options.&lt;br /&gt;
&lt;br /&gt;
OPTIONS also accepts a CACHE keyword that can be used to enable or disable an internal statement-caching scheme. The cache is normally enabled. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
OPTIONS FAILAT 10&lt;br /&gt;
OPTIONS PROMPT &amp;quot;Yes Boss?&amp;quot;&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OTHERWISE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OTHERWISE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction is valid only within the range of a SELECT instruction and must follow all of the &amp;quot;WHEN ... THEN&amp;quot; statements. If none of the preceding WHEN clauses has succeeded, the statement following the OTHERWISE instruction is executed. An OTHERWISE is not mandatory within a SELECT range. However, an error will result if the OTHERWISE clause is omitted and none of the WHEN instructions succeeds. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN say &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN say &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PARSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PARSE [UPPER] inputsource [template] [,template ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PARSE instruction provides a mechanism to extract one or more substrings from a string and assign them to variables. The input string can come from a variety of sources, including argument strings, an expression, or from the console.&lt;br /&gt;
&lt;br /&gt;
Parsing is controlled by a template, which may consist of symbols, strings, operators and parentheses. The template provides both the variables to be given values and the way to determine the value strings. During the parsing operation the input string is split into substrings that are assigned to the variable symbols in the template. The process continues until all of the variables in the template have been assigned a value. If the input string is &amp;quot;used up&amp;quot;, any remaining variables are given null values.&lt;br /&gt;
&lt;br /&gt;
When a variable in the template is followed immediately by another variable, the value string is determined by breaking the input string into words separated by blanks. Leading and trailing blanks are not permitted. Each word is assigned to a variable in the template. Normally the last variable receives the untokenized remainder of the input string, since it is not followed by a symbol. A placeholder symbol, a period (.), forces the variable with the period to terminate at the first space in the input stream. Placeholders behave like variables except that they are never assigned a value.&lt;br /&gt;
&lt;br /&gt;
The template may be omitted if the instruction is intended only to create the input string. Templates are described in Chapter 7.&lt;br /&gt;
&lt;br /&gt;
The goal of the parsing operation is to associate a current and next position with each variable symbol in the template. The substring between these positions is then assigned as the value to the variable.&lt;br /&gt;
&lt;br /&gt;
The different options of the instruction are described below.&lt;br /&gt;
&lt;br /&gt;
* The optional UPPER keyword may be used with any of the input sources and specifies that the input string is to be translated to upper case before being parsed. It must be the first token following PARSE.&lt;br /&gt;
* The sources for the input strings are specified by the keyword symbols explained below. When multiple templates are supplied, each template receives a new input string, although for some source options the new string will be identical to the previous one. The input source string is copied before being parsed, so the original strings are never altered by the parsing process.&lt;br /&gt;
:* The ARG input option retrieves the argument strings supplied when the program was invoked. Command invocations normally have only a single argument string, but functions may have up to 15 argument strings.&lt;br /&gt;
:* The EXTERNAL input string is read from STDERR stream, (see Chapter 6) so as not to disturb any PUSHed or QUEUEd data. If multiple templates are supplied, each template will read a new string. This source option is the same as PULL.&lt;br /&gt;
:* The NUMERIC input option places the current numeric options in a string in the order DIGITS, FUZZ and FORM, separated by a single space.&lt;br /&gt;
:* The PULL input option reads a string from the input console. If multiple templates are supplied, each template will read a new string.&lt;br /&gt;
:* The SOURCE input option retrieves the &amp;quot;source&amp;quot; string for the program. This string is formatted as:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
{COMMAND | FUNCTION} {0 | 1} CALLED RESOLVED EXT HOST&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* {COMMAND | FUNCTION} indicates whether the program was invoked as a command or as a function.&lt;br /&gt;
:* {0 | 1} is a Boolean flag indicating whether a result string was requested by the caller.&lt;br /&gt;
:* CALLED is the name used to invoke this program.&lt;br /&gt;
:* RESOLVED is the final resolved name of the program.&lt;br /&gt;
:* EXT is the file extension to be used for searching (the default is &amp;quot;REXX&amp;quot;).&lt;br /&gt;
:* HOST is the initial host address for commands.&lt;br /&gt;
: The SOURCE option now returns the full path name of the ARexx program file. Formerly just a relative name was given, which was not sufficient to locate the program&#039;s source file.&lt;br /&gt;
: The &amp;quot;VALUE expression WITH&amp;quot; input string is the result of the supplied expression. The WITH keyword is required to separate the expression from the template. The expression result may be parsed repeatedly by using multiple templates, but the expression is not re-evaluated.&lt;br /&gt;
: The &amp;quot;VAR variable&amp;quot; input option uses the value of the specified variable as the input string. When multiple templates are provided, each template uses the current value of the variable. This value may change if the variable is included as an assignment target in any of the templates.&lt;br /&gt;
: The VERSION input option of the current configuration of the ARexx interpreter is supplied in the form:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARexx VERSION CPU MPU VIDEO FREQ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* VERSION is the release level of the interpreter, formatted as 1.14.&lt;br /&gt;
:* CPU indicates the processor currently running the program, and will be one of the values 68000, 68010, 68020, 68030 or 68040.&lt;br /&gt;
:* MPU will be either NONE, 68881, or 68882, depending on whether a math coprocessor is available.&lt;br /&gt;
:* VIDEO will indicate either NTSC or PAL.&lt;br /&gt;
:* FREQ gives the clock (line) frequency as either 60Hz or 50Hz.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Numeric string is: &amp;quot;9 0 SCIENTIFIC&amp;quot;*/&lt;br /&gt;
PARSE NUMERIC DIGITS FUZZ FORM .&lt;br /&gt;
SAY Digits /*9*/&lt;br /&gt;
SAY fuzz /*0*/&lt;br /&gt;
SAY form /*SCIENTIFIC*/&lt;br /&gt;
myvar = 1234567890&lt;br /&gt;
PARSE VAR myvar 1 a 3 b +2 c 1 d&lt;br /&gt;
SAY a&lt;br /&gt;
SAY b&lt;br /&gt;
SAY c&lt;br /&gt;
SAY d&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the output:&lt;br /&gt;
&lt;br /&gt;
 12&lt;br /&gt;
 34&lt;br /&gt;
 567890&lt;br /&gt;
 1234567890&lt;br /&gt;
&lt;br /&gt;
== PROCEDURE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PROCEDURE [EXPOSE variable [variable...]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PROCEDURE instruction is used within an internal function to create a new symbol table. This protects the symbols defined in the caller&#039;s environment from being altered by the execution of the function. PROCEDURE is usually the first statement within the function, although it is valid anywhere within the function body. It is an error to execute two PROCEDURE statements within the same function.&lt;br /&gt;
&lt;br /&gt;
The EXPOSE subkeyword provides a selective mechanism for accessing the caller&#039;s symbol table, and or passing global variables to a function. The variables following the EXPOSE keyword are taken to refer to symbols in the caller&#039;s table. Any subsequent changes made to these variables will be reflected in the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The variables in the EXPOSE list may include stem or compound symbols, in which case the ordering of the variables becomes significant. The EXPOSE list is processed from left to right and compound symbols are expanded based on the values in effect in the new generation. For example, suppose that the value of the symbol J in the previous generation is 123, and that J is uninitialized in the new generation. Then PROCEDURE EXPOSE J A.J will expose J and A.123, whereas PROCEDURE EXPOSE A.J J will expose A.J and J. Exposing a stem has the effect of exposing all possible compound symbols derived from that stem. That is, PROCEDURE EXPOSE A. exposes A.I, A.J, A.J.J, A.123, etc. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
fact: PROCEDURE /*A recursive function*/&lt;br /&gt;
   ARG i&lt;br /&gt;
   IF i = 1&lt;br /&gt;
   THEN RETURN 1&lt;br /&gt;
   ELSE RETURN i * fact (i-1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PULL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PULL [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pull is the shorthand form of the PARSE UPPER PULL instruction. It reads a string from the input console, translates it to upper case and parses it using the template. Multiple strings can be read by supplying additional templates. The instruction will read from the console even if no template is given. (Templates are described in Chapter 7.) For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PULL first last . /*Read names*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PUSH ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PUSH [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PUSH instruction is used to prepare a stream of data to be read by a command shell or other program. It appends a newline to the result of the expression then stacks or &amp;quot;pushes&amp;quot; it into the STDIN stream. Stacked lines are placed in the stream in &amp;quot;last-in, first-out&amp;quot; order and are available to be read just as though they had been entered interactively. For example, after issuing the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH line 1&lt;br /&gt;
PUSH line 2&lt;br /&gt;
PUSH line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the stream would be read in the order line 3, line 2, and line 1.&lt;br /&gt;
&lt;br /&gt;
PUSH allows the STDIN stream to be used as a private scratch pad to prepare data for subsequent processing. For example, several files could be concatenated with delimiters between them by simply reading the input files, PUSHing the line into the stream and inserting a delimiter where required. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   PUSH &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QUEUE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;QUEUE [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The QUEUE instruction is used to prepare a stream of data to be read by a command shell or other program. It is very similar to the PUSH instruction and differs only in that the data lines are placed in the STDIN stream in &amp;quot;first-in, first-out&amp;quot; order. In this case, the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
QUEUE line 1&lt;br /&gt;
QUEUE line 2&lt;br /&gt;
QUEUE line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would be read in the order line 1, line 2, and line 3. The QUEUEd lines always precede all interactively-entered lines and always follow any PUSHed (stacked) lines. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   QUEUE &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RETURN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RETURN [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RETURN is used to leave a function and return control to the point of the function&#039;s invocation. The evaluated expression is returned as the function result. If an expression is not supplied, an error may result in the caller&#039;s environment. Functions called from within an expression must return a result string and will generate an error if no result is available. Functions invoked by the CALL instruction need to return a result.&lt;br /&gt;
&lt;br /&gt;
A RETURN issued from the base environment of a program is not an error and is equivalent to an EXIT instruction. Refer to the EXIT instruction for a description of how result strings are passed back to an external caller. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
RETURN 6*7 /*Returns 42*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAY ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SAY [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result of the evaluated expressions is written to the output console, with a newline character appended. If the expression is omitted, a null string is sent to the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY &#039;The answer is &#039; value &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SELECT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SELECT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT begins a group of instructions containing one or more WHEN clauses and possibly a single OTHERWISE clause, each followed by a conditional statement. Only one of the conditional statements within the SELECT group will be executed. Each WHEN statement is executed in succession until one succeeds. If none succeeds, the OTHERWISE statement is executed. The SELECT range must be terminated by an END statement. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN SAY &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN SAY &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHELL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHELL [symbol | string | [[VALUE] [expression]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SHELL instruction is a synonym for the ADDRESS instruction. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SHELL edit /*Set host to `EDIT&#039;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SIGNAL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGNAL {ON | OFF} condition SIGNAL [VALUE] expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SIGNAL {ON | OFF} controls the state of the internal interrupt flags. Interrupts allow a program to detect and retain control when certain errors occur. In this form SIGNAL must be followed by one of the keywords ON or OFF and one of the condition keywords listed below. The interrupt flag specified by the condition symbol is then set to the indicated state. The valid signal conditions are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;BREAK_C&#039;&#039;&#039; || A Ctrl+C break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_D&#039;&#039;&#039; || A Ctrl+D break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_E&#039;&#039;&#039; || A Ctrl+E break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_F&#039;&#039;&#039; || A Ctrl+F break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ERROR&#039;&#039;&#039; || A host command returned a non-zero code.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;HALT&#039;&#039;&#039; || An external HALT request was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOERR&#039;&#039;&#039; || An error was detected by the I/O system.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;NOVALUE&#039;&#039;&#039; || An uninitialized variable was used.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SYNTAX&#039;&#039;&#039; || A syntax or execution error was detected.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The condition keywords are interpreted as labels to which control will be transferred if the selected condition occurs. For example, if the ERROR interrupt is enabled and a command returns a non-zero code, ARexx will transfer control to the label ERROR:. The condition label must be defined in the program; otherwise, an immediate SYNTAX error results and the program exits.&lt;br /&gt;
&lt;br /&gt;
In SIGNAL [VALUE] expression, the tokens following SIGNAL are evaluated as an expression. An immediate interrupt is generated that transfers control to the label specified by the expression result. The instruction thus acts as a &amp;quot;computed goto&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Whenever an interrupt occurs, all currently active control ranges (IF, DO, SELECT, INTERPRET, or interactive TRACE) are dismantled before the transfer of control. Thus, the transfer cannot be used to jump into the range of a DO loop or other control structure. Only the control structures in the current environment are affected by a SIGNAL condition, making it safe to SIGNAL from within an internal function without affecting the state of the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The special variable SIGL is set to the current line number whenever a transfer of control occurs. The program can inspect SIGL to determine which line was being executed before the transfer. If an ERROR or SYNTAX condition causes an interrupt, the special variable RC is set to the error code that triggered the interrupt. For the ERROR condition, this code is usually an error severity level. Refer to Appendix A for further details on error codes and severity levels. The SYNTAX condition will always indicate an ARexx error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SIGNAL on error /*Enable interrupt*/&lt;br /&gt;
SIGNAL off syntax /*Disable SYNTAX*/&lt;br /&gt;
SIGNAL start /*Goto START*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WHEN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WHEN expression [THEN [;] [conditional statement]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The WHEN instruction is similar to the IF instruction, but is valid only within a SELECT range. Each WHEN expression is evaluated in turn and must result in a Boolean value. If the result is a 1, the conditional statement is executed and control passes to the END statement that terminates the SELECT. As with the IF instruction, the THEN need not be part of the same clause. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i&amp;lt;j THEN SAY &#039;less&#039;&lt;br /&gt;
   WHEN i=j THEN SAY &#039;equal&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;greater&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6856</id>
		<title>AmigaOS Manual: ARexx Instructions</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Instructions&amp;diff=6856"/>
		<updated>2014-01-26T10:19:02Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An instruction clause begins with the name of a particular instruction and tells ARexx to perform a certain action. This chapter provides an alphabetical list of the instructions available in ARexx.&lt;br /&gt;
&lt;br /&gt;
Each instruction keyword may be followed by one or more subkeywords, expressions, or other instruction-specific information. Instruction keywords and subkeywords are recognized only in this specific context. This allows the same keywords to be used in a different context as variables or function names. An instruction keyword cannot be followed by a colon (:) or an equals (=) operator.&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&lt;br /&gt;
The syntax for each instruction is shown to the right of the keyword heading. The conventions used in the syntax are shown in Table 4-1:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 4-1. Syntax Conventions&lt;br /&gt;
! Convention !! Definition&lt;br /&gt;
|-&lt;br /&gt;
| KEYWORD || All keywords and subkeywords are shown in uppercase letters&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; (vertical bar) || Alternative selections are separated by a vertical bar&lt;br /&gt;
|-&lt;br /&gt;
| { } (braces) || Required alternatives are enclosed by braces&lt;br /&gt;
|-&lt;br /&gt;
| [ ] (brackets) || Optional instruction parts are enclosed in brackets&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|The syntax conventions do not apply to the specifications following the keyword heading. They only apply to the syntax shown to the right of the instruction keyword.}}&lt;br /&gt;
&lt;br /&gt;
For example, the format for the CALL instruction is:&lt;br /&gt;
&lt;br /&gt;
 CALL {symbol | string} [expression] [,expression,...]&lt;br /&gt;
&lt;br /&gt;
You must supply a symbol or a string as an argument. The vertical bar identifies the alternative selections, and the braces indicate that the use of an argument is required. The specification of an expression is optional, as indicated by the brackets.&lt;br /&gt;
&lt;br /&gt;
Examples are given at the end of the instruction specification. Explanations or evaluations of the examples are shown as ARexx comments /*...*/.&lt;br /&gt;
&lt;br /&gt;
= Alphabetical Reference =&lt;br /&gt;
&lt;br /&gt;
This section provides an alphabetical list of ARexx&#039;s built-in instructions. The syntax of each instruction is shown to the right of the instruction keyword.&lt;br /&gt;
&lt;br /&gt;
== ADDRESS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ADDRESS [[symbol | string] | [VALUE][expressions]] &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction specifies a host address for commands issued by the interpreter. A host address is the name of an application&#039;s message port to which ARexx commands are sent. ARexx maintains two host addresses: a current and a previous value. Whenever a new host address is supplied, the previous address is lost and the current address becomes the previous one. These host addresses are part of a program&#039;s storage environment and are preserved across internal function calls. The current address can be retrieved with the built-in function ADDRESS().&lt;br /&gt;
&lt;br /&gt;
The ADDRESS keyword alone interchanges the current and previous hosts. Repeated execution will toggle between the two host addresses.&lt;br /&gt;
&lt;br /&gt;
ADDRESS {string | symbol]} specifies that the new host address is the string or symbol. The value of the string or symbol is the token itself. Message port names are case-sensitive. The appropriate syntax for a program command to a message port named MyPort is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS &#039;MyPort&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Omit the single quotes around MyPort and ARexx looks for the message port MYPORT and generates an error. The current host address becomes the previous address. An expression specified after a string or symbol is evaluated and the result is issued to the specified host. No changes are made to the current or previous address strings. This provides a convenient way to issue a single command to an external host without disturbing the current host addresses. The return code from the command is treated as it would be from a command clause.&lt;br /&gt;
&lt;br /&gt;
If ADDRESS [VALUE] expression is specified. ARexx uses the result of the expression as the new host address, and the current address becomes the previous address. The VALUE keyword may be omitted if the first token of the expression is not a symbol or string. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ADDRESS /*Swap current and previous address.*/&lt;br /&gt;
ADDRESS edit /*The new host address is EDIT.*/&lt;br /&gt;
ADDRESS edit &#039;top&#039; /*Move to the top.*/&lt;br /&gt;
ADDRESS VALUE edit in /*Compute a new host address.*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ARG ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ARG [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ARG is a shorthand form for the PARSE UPPER ARG instruction. It retrieves one or more of the argument strings available to the program and assigns values to the variables in the template. The number of argument strings available depends on whether the program was invoked as a command or a function. Command invocations normally have only one argument string, but functions may have up to 15. The argument strings are not altered by the ARG instruction. ARG returns uppercase letters. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARG first,second /*Retrieve arguments*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure and processing of templates is described briefly with the PARSE instruction.&lt;br /&gt;
&lt;br /&gt;
== BREAK ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;BREAK&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The BREAK instruction is used to exit from the range of a DO instruction or from within an INTERPRETed string. It is valid only in these contexts. If used within a DO statement, BREAK exits from the innermost DO statement containing the BREAK. This contrasts with the similar LEAVE instruction, which exits only from an iterative (repeating) DO. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO /*Begin block*/&lt;br /&gt;
 IF i&amp;gt;3 THEN BREAK /*Finished?*/&lt;br /&gt;
 a = a + 1&lt;br /&gt;
 y.a = name&lt;br /&gt;
 END /*End block*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CALL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;CALL {symbol | string} [expressions] [,expression, ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CALL instruction is used to invoke an internal or external function. The function name is specified by the symbol or string token. Any expressions that follow are evaluated and become the arguments to the called function. The value returned by the function is assigned to the special variable RESULT. It is not an error if a result string is not returned. In this case the variable RESULT is DROPped (becomes uninitialized).&lt;br /&gt;
&lt;br /&gt;
The linkage to the function is established dynamically at the time of the call. ARexx follows a specific search order in attempting to locate the called function. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL CENTER name, length+4, &#039;+&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CENTER is the called function. The expressions will be evaluated and passed as arguments to CENTER.&lt;br /&gt;
&lt;br /&gt;
== DO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DO [[var=exp] | [exp] [TO exp] [BY exp]] [FOR exp] [FOREVER] [WHILE exp | UNTIL exp]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction begins a group of instructions executed as a block. The range of the DO instruction includes all statements up to and including an eventual END instruction.&lt;br /&gt;
&lt;br /&gt;
If not subkeywords follow the DO instruction, the block is executed once. Subkeywords can be used to iterate the block until a termination condition occurs. An interative DO instruction is sometimes called a loop since ARexx &amp;quot;loops back&amp;quot; to perform the instruction repeatedly. The various parts of the DO instruction are:&lt;br /&gt;
&lt;br /&gt;
* An initializer expression of the form &amp;quot;variable=expression&amp;quot; defines the index variable of the loop. The expression is evaluated when the DO range is first activated and the result is assigned to the index variable. On subsequent iterations an expression of the form &amp;quot;variable = variable + increment&amp;quot; is evaluated, where the increment is the result of the BY expression. If specified, the initializer expression must precede any of the other subkeywords.&lt;br /&gt;
&lt;br /&gt;
* The expression following a BY symbol defines the increment to be added to the index variable in each subsequent iteration. The expression must yield a numeric result, which may be positive or negative and need not be an integer. The default increment is 1.&lt;br /&gt;
&lt;br /&gt;
* The result of the TO expression specifies the upper (or lower) limit for the index variable. At each iteration the index variable is compared to the TO result. If the increment (BY result) is positive and the variable is greater than the limit, the DO instruction terminates and control passes to the statement following the END instruction. The loop also terminates if the increment is negative and the index variable is less than the limit.&lt;br /&gt;
&lt;br /&gt;
* The FOR expression must yield a positive whole number when evaluated and specifies the maximum number of iterations to be performed. The loop terminates when this limit is reached, irrespective of the value of the index variable.&lt;br /&gt;
&lt;br /&gt;
* The initializer BY, TO and FOR expressions are evaluated only when the instruction is first activated, so the increment and limits are fixed through the execution. A limit is not required. For example, the instruction &amp;quot;DO i=1&amp;quot; will simply count away forever.&lt;br /&gt;
&lt;br /&gt;
* The FOREVER keyword can be used if an iterative DO instruction is required but no index variable is necessary. The loop will be terminated by a LEAVE or BREAK instruction contained within the loop.&lt;br /&gt;
&lt;br /&gt;
* The WHILE expression is evaluated at the beginning of each iteration and must result in a Boolean value. The iteration proceeds if the result is 1 (true); otherwise, the loop terminates.&lt;br /&gt;
&lt;br /&gt;
* The UNTIL expression is evaluated at the end of each iteration and must result in a Boolean value. The instruction continues with the next iteration if the result is 0 (false), and terminates otherwise. (WHILE and UNTIL are mutually exclusive.)&lt;br /&gt;
&lt;br /&gt;
=== Program 12. Iteration.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Examples of DO*/&lt;br /&gt;
LIMIT = 20; number = 1&lt;br /&gt;
DO i=1 to LIMIT for 10 WHILE number &amp;lt; 20&lt;br /&gt;
   number = i * number&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
number = number/3.345; i = 0&lt;br /&gt;
DO number for LIMIT/5&lt;br /&gt;
   i = i + 1&lt;br /&gt;
   SAY &amp;quot;Iteration&amp;quot; i &amp;quot;number=&amp;quot; number&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is shown with comment lines for explanation. The comments would not appear on your screen.&lt;br /&gt;
&lt;br /&gt;
 Iteration 1 number = 1 /*1 * 1 = 1*/&lt;br /&gt;
 Iteration 2 number = 2 /*2 * 1 = 2*/&lt;br /&gt;
 Iteration 3 number = 6 /*3 * 2 = 6*/&lt;br /&gt;
 Iteration 4 number = 24 /*4 * 6 = 24*/&lt;br /&gt;
 Iteration 1 number = 7.17488789 /*24/3.345 = 7.17488789*/&lt;br /&gt;
 Iteration 2 number = 7.17488789 /*number doesn&#039;t change*/&lt;br /&gt;
 Iteration 3 number = 7.17488789 /*limit/5 = 20/5 = 4*/&lt;br /&gt;
 Iteration 4 number = 7.17488789 /*operation repeats 4 times*/&lt;br /&gt;
&lt;br /&gt;
{{Note|If a FOR limit is also present, the initial expression is still evaluated, but the result need not be a positive integer.}}&lt;br /&gt;
&lt;br /&gt;
== DROP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;DROP variable [variable ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The specified variable symbols are reset to their unintialized state, in which the value of the variable is the variable name itself. It is not an error to DROP a variable that is already uninitialized. DROPping a stem symbol is equivalent to DROPping the values of all possible compound symbols derived from the stem. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
a = 123 /*Assign a value to a */&lt;br /&gt;
DROP a b /*DROP (remove) the values from A and B*/&lt;br /&gt;
SAY a b /*Results in A B.*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ECHO ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ECHO [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ECHO instruction is a synonym for the SAY instruction. It displays the expression result on the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ECHO &amp;quot;you don&#039;t say&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ELSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ELSE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ELSE instruction provides the alternative conditional branch for an IF statement. It is valid only within the range of an IF instruction and must follow the conditional statement of the THEN branch. If the THEN branch isn&#039;t executed, the statement following the ELSE clause is performed.&lt;br /&gt;
&lt;br /&gt;
ELSE clauses always bind to the nearest, preceding IF statement. It may be necessary to provide &amp;quot;dummy&amp;quot; ELSE clauses for the inner IF ranges of a compound IF statement to allow alternative branches for the outer IF statements. It is not sufficient to follow the ELSE with a semicolon or a null clause. Instead, the NOP (no-operation) instruction can be used. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i &amp;gt; 2 THEN SAY &#039;Really?&#039;&lt;br /&gt;
ELSE SAY &#039;I thought so&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== END ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;END [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The END instruction terminates the range of a DO or SELECT instruction. If the optional variable symbol is supplied, it is compared to the index variable of the DO statement (which must be iterative). An error is generated if the symbols do not match. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5 /*Index variable is i*/&lt;br /&gt;
   SAY i&lt;br /&gt;
   END i /*End &amp;quot;i&amp;quot; loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== EXIT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EXIT [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The EXIT instruction terminates the execution of a program. It is valid anywhere within a program. The evaluated expression is passed back to the caller as the function or command result.&lt;br /&gt;
&lt;br /&gt;
The processing of the EXIT result depends on whether a result string was requested by the calling program and whether the current invocation resulted from a command or function call.&lt;br /&gt;
&lt;br /&gt;
* If a result string was requested, the expression result is copied to a block of allocated memory and a pointer to the block is returned as the secondary result of the call.&lt;br /&gt;
&lt;br /&gt;
* If the caller did not request a result string and the program was invoked as a command, an attempt is made to convert the expression result to an integer. This value is then returned as the primary result, with 0 as the secondary result. This allows the EXIT information to be interpreted as a return code by the caller.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
EXIT /*No result needed*/&lt;br /&gt;
EXIT 10 /*An error return*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IF ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;IF expression [THEN] [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF instruction is used in conjunction with THEN and ELSE instructions to conditionally execute a statement. The result of the expression must be a Boolean value. If the result is 1 (True), the statement following the THEN symbol is executed. Otherwise, control passes to the next statement. The THEN keyword need not immediately follow the IF expression, but may appear as a separate clause.&lt;br /&gt;
&lt;br /&gt;
The instruction is analyzed as &amp;quot;IF expression; THEN; statement&amp;quot;. The expression following the IF statement establishes the test condition that determines whether subsequent THEN or ELSE clauses will be performed. Any valid statement may follow the THEN symbol. In particular, a &amp;quot;DO ... END;&amp;quot; group allows a series of statements to be performed conditionally. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF result &amp;lt; 0 THEN exit /*All done?*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INTERPRET ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;INTERPRET expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The INTERPRET command treats the expression as though it were a source statement block. The expression is evaluated and the result is executed as one or more program statements. The statements are considered as a group, as if surrounded by a &amp;quot;DO ... END&amp;quot; combination. Any statements can be included in the INTERPRETed source, including DO or SELECT instructions. The BREAK instruction can be used to terminate the processing of INTERPRETed statements.&lt;br /&gt;
&lt;br /&gt;
An INTERPRET instruction activates a control range when it is executed, which serves as a boundary for LEAVE and ITERATE instructions. These instructions can only be used with DO loops defined within the INTERPRET. While it is not an error to include label clauses within the interpreted string, only those labels defined in the original program are searched during a transfer of control.&lt;br /&gt;
&lt;br /&gt;
The INTERPRET instruction can be used to construct programs dynamically and then execute them. Program fragments may be passed as arguments to functions, which then INTERPRET the fragments. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
inst = `SAY&#039; /*An instruction*/&lt;br /&gt;
INTERPRET inst hello /*. . . &amp;quot;SAY HELLO&amp;quot;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ITERATE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ITERATE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ITERATE instruction terminates the current iteration of a DO instruction and begins the next iteration. Effectively, control passes to the END statement and then (depending on the outcome of the UNTIL expression) back to the DO statement. The instruction normally acts on the innermost iterative DO range. An error results if the ITERATE instruction is not contained within an iterative DO instruction.&lt;br /&gt;
&lt;br /&gt;
If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   IF i = 3 THEN ITERATE i&lt;br /&gt;
   SAY i&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== LEAVE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;LEAVE [variable]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LEAVE forces an immediate exit from the iterative DO range containing the instruction. An error results if the LEAVE instruction is not contained within an iterative DO instruction. If several nested ranges exist, the optional variable symbol specifies which DO range is to be exited. The variable is taken as a literal and must match the index variable of a currently active DO instruction. An error results if a matching DO instruction is not found. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i = 1 to limit&lt;br /&gt;
   IF i &amp;gt; 5 THEN LEAVE /*Maximum iterations*/&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NOP ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NOP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The NOP (NO-oPeration) instruction is provided to control the binding of ELSE clauses in compound IF statements. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IF i = j THEN           /*First (outer) IF*/&lt;br /&gt;
   IF j = k THEN a = 0  /*Inner IF*/&lt;br /&gt;
      ELSE NOP          /*Binds to inner IF*/&lt;br /&gt;
   ELSE a = a + 1       /*Binds to outer IF*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== NUMERIC ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NUMERIC {DIGITS | FUZZ} expression NUMERIC FORM {SCIENTIFIC | ENGINEERING}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The NUMERIC instruction sets options relating to numeric precision and format. The numeric options are preserved when an internal function is called.&lt;br /&gt;
&lt;br /&gt;
* The DIGITS expression option specifies the number of digits of precision for arithmetic calculations. The expression must evaluate to a positive whole number.&lt;br /&gt;
&lt;br /&gt;
* The FUZZ expression option specifies the number of digits to be ignored in numeric comparison operations. This must be a positive whole number, less than the current DIGITS setting.&lt;br /&gt;
&lt;br /&gt;
* The FORM SCIENTIFIC option specifies that numbers that require exponential notation be expressed in scientific notation. The exponent is adjusted so that the mantissa for non-zero number is between 1 and 10. This is the default format.&lt;br /&gt;
&lt;br /&gt;
* The FORM ENGINEERING option selects engineering format for numbers that require exponential notation. Engineering format normalizes a number so that its exponent is a multiple of three and the mantissa (if not 0) is between 1 and 1000.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NUMERIC DIGITS 12 /*12 digits of precision*/&lt;br /&gt;
NUMERIC FORM SCIENTIFIC /*Result in scientific notation*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OPTIONS ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [FAILAT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [PROMPT expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [RESULTS]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OPTIONS [CACHE]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The OPTIONS instruction is used to set various internal defaults. The FAILAT expression sets the limit at or above which command return codes will be signaled as errors. It must evaluate to an integer value. The PROMPT expression provides a string to be used as the prompt with the PULL (or PARSE PULL) instruction. The RESULTS keyword indicates that the interpreter should request a result string when it issues commands to an external host.&lt;br /&gt;
&lt;br /&gt;
The internal options controlled by this instruction are preserved across function calls, so an OPTIONS instruction can be issued within an internal function without affecting the caller&#039;s environment. If no keyword is specified with the OPTIONS instruction, all controlled options revert to their default settings. The OPTIONS instruction also accepts a NO keyword to reset a selected option to its default value, making it more convenient to reset the RESULTS attribute for a single command without having to reset the FAILAT and PROMPT options.&lt;br /&gt;
&lt;br /&gt;
OPTIONS also accepts a CACHE keyword that can be used to enable or disable an internal statement-caching scheme. The cache is normally enabled. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
OPTIONS FAILAT 10&lt;br /&gt;
OPTIONS PROMPT &amp;quot;Yes Boss?&amp;quot;&lt;br /&gt;
OPTIONS RESULTS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OTHERWISE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;OTHERWISE [;] [conditional statement]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This instruction is valid only within the range of a SELECT instruction and must follow all of the &amp;quot;WHEN ... THEN&amp;quot; statements. If none of the preceding WHEN clauses has succeeded, the statement following the OTHERWISE instruction is executed. An OTHERWISE is not mandatory within a SELECT range. However, an error will result if the OTHERWISE clause is omitted and none of the WHEN instructions succeeds. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN say &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN say &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PARSE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PARSE [UPPER] inputsource [template] [,template ...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PARSE instruction provides a mechanism to extract one or more substrings from a string and assign them to variables. The input string can come from a variety of sources, including argument strings, an expression, or from the console.&lt;br /&gt;
&lt;br /&gt;
Parsing is controlled by a template, which may consist of symbols, strings, operators and parentheses. The template provides both the variables to be given values and the way to determine the value strings. During the parsing operation the input string is split into substrings that are assigned to the variable symbols in the template. The process continues until all of the variables in the template have been assigned a value. If the input string is &amp;quot;used up&amp;quot;, any remaining variables are given null values.&lt;br /&gt;
&lt;br /&gt;
When a variable in the template is followed immediately by another variable, the value string is determined by breaking the input string into words separated by blanks. Leading and trailing blanks are not permitted. Each word is assigned to a variable in the template. Normally the last variable receives the untokenized remainder of the input string, since it is not followed by a symbol. A placeholder symbol, a period (.), forces the variable with the period to terminate at the first space in the input stream. Placeholders behave like variables except that they are never assigned a value.&lt;br /&gt;
&lt;br /&gt;
The template may be omitted if the instruction is intended only to create the input string. Templates are described in Chapter 7.&lt;br /&gt;
&lt;br /&gt;
The goal of the parsing operation is to associate a current and next position with each variable symbol in the template. The substring between these positions is then assigned as the value to the variable.&lt;br /&gt;
&lt;br /&gt;
The different options of the instruction are described below.&lt;br /&gt;
&lt;br /&gt;
* The optional UPPER keyword may be used with any of the input sources and specifies that the input string is to be translated to upper case before being parsed. It must be the first token following PARSE.&lt;br /&gt;
* The sources for the input strings are specified by the keyword symbols explained below. When multiple templates are supplied, each template receives a new input string, although for some source options the new string will be identical to the previous one. The input source string is copied before being parsed, so the original strings are never altered by the parsing process.&lt;br /&gt;
:* The ARG input option retrieves the argument strings supplied when the program was invoked. Command invocations normally have only a single argument string, but functions may have up to 15 argument strings.&lt;br /&gt;
:* The EXTERNAL input string is read from STDERR stream, (see Chapter 6) so as not to disturb any PUSHed or QUEUEd data. If multiple templates are supplied, each template will read a new string. This source option is the same as PULL.&lt;br /&gt;
:* The NUMERIC input option places the current numeric options in a string in the order DIGITS, FUZZ and FORM, separated by a single space.&lt;br /&gt;
:* The PULL input option reads a string from the input console. If multiple templates are supplied, each template will read a new string.&lt;br /&gt;
:* The SOURCE input option retrieves the &amp;quot;source&amp;quot; string for the program. This string is formatted as:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
{COMMAND | FUNCTION} {0 | 1} CALLED RESOLVED EXT HOST&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* {COMMAND | FUNCTION} indicates whether the program was invoked as a command or as a function.&lt;br /&gt;
:* {0 | 1} is a Boolean flag indicating whether a result string was requested by the caller.&lt;br /&gt;
:* CALLED is the name used to invoke this program.&lt;br /&gt;
:* RESOLVED is the final resolved name of the program.&lt;br /&gt;
:* EXT is the file extension to be used for searching (the default is &amp;quot;REXX&amp;quot;).&lt;br /&gt;
:* HOST is the initial host address for commands.&lt;br /&gt;
: The SOURCE option now returns the full path name of the ARexx program file. Formerly just a relative name was given, which was not sufficient to locate the program&#039;s source file.&lt;br /&gt;
: The &amp;quot;VALUE expression WITH&amp;quot; input string is the result of the supplied expression. The WITH keyword is required to separate the expression from the template. The expression result may be parsed repeatedly by using multiple templates, but the expression is not re-evaluated.&lt;br /&gt;
: The &amp;quot;VAR variable&amp;quot; input option uses the value of the specified variable as the input string. When multiple templates are provided, each template uses the current value of the variable. This value may change if the variable is included as an assignment target in any of the templates.&lt;br /&gt;
: The VERSION input option of the current configuration of the ARexx interpreter is supplied in the form:&lt;br /&gt;
: &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ARexx VERSION CPU MPU VIDEO FREQ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
: where:&lt;br /&gt;
:* VERSION is the release level of the interpreter, formatted as 1.14.&lt;br /&gt;
:* CPU indicates the processor currently running the program, and will be one of the values 68000, 68010, 68020, 68030 or 68040.&lt;br /&gt;
:* MPU will be either NONE, 68881, or 68882, depending on whether a math coprocessor is available.&lt;br /&gt;
:* VIDEO will indicate either NTSC or PAL.&lt;br /&gt;
:* FREQ gives the clock (line) frequency as either 60Hz or 50Hz.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Numeric string is: &amp;quot;9 0 SCIENTIFIC&amp;quot;*/&lt;br /&gt;
PARSE NUMERIC DIGITS FUZZ FORM .&lt;br /&gt;
SAY Digits /*9*/&lt;br /&gt;
SAY fuzz /*0*/&lt;br /&gt;
SAY form /*SCIENTIFIC*/&lt;br /&gt;
myvar = 1234567890&lt;br /&gt;
PARSE VAR myvar 1 a 3 b +2 c 1 d&lt;br /&gt;
SAY a&lt;br /&gt;
SAY b&lt;br /&gt;
SAY c&lt;br /&gt;
SAY d&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the output:&lt;br /&gt;
&lt;br /&gt;
 12&lt;br /&gt;
 34&lt;br /&gt;
 567890&lt;br /&gt;
 1234567890&lt;br /&gt;
&lt;br /&gt;
== PROCEDURE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PROCEDURE [EXPOSE variable [variable...]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PROCEDURE instruction is used within an internal function to create a new symbol table. This protects the symbols defined in the caller&#039;s environment from being altered by the execution of the function. PROCEDURE is usually the first statement within the function, although it is valid anywhere within the function body. It is an error to execute two PROCEDURE statements within the same function.&lt;br /&gt;
&lt;br /&gt;
The EXPOSE subkeyword provides a selective mechanism for accessing the caller&#039;s symbol table, and or passing global variables to a function. The variables following the EXPOSE keyword are taken to refer to symbols in the caller&#039;s table. Any subsequent changes made to these variables will be reflected in the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The variables in the EXPOSE list may include stem or compound symbols, in which case the ordering of the variables becomes significant. The EXPOSE list is processed from left to right and compound symbols are expanded based on the values in effect in the new generation. For example, suppose that the value of the symbol J in the previous generation is 123, and that J is uninitialized in the new generation. Then PROCEDURE EXPOSE J A.J will expose J and A.123, whereas PROCEDURE EXPOSE A.J J will expose A.J and J. Exposing a stem has the effect of exposing all possible compound symbols derived from that stem. That is, PROCEDURE EXPOSE A. exposes A.I, A.J, A.J.J, A.123, etc. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
fact: PROCEDURE /*A recursive function*/&lt;br /&gt;
   ARG i&lt;br /&gt;
   IF i = 1&lt;br /&gt;
   THEN RETURN 1&lt;br /&gt;
   ELSE RETURN i * fact (i-1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PULL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PULL [template] [,template...]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pull is the shorthand form of the PARSE UPPER PULL instruction. It reads a string from the input console, translates it to uppercase and parses it using the template. Multiple strings can be read by supplying additional templates. The instruction will read from the console even if no template is given. (Templates are described in Chapter 7.) For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PULL first last . /*Read names*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PUSH ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;PUSH [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PUSH instruction is used to prepare a stream of data to be read by a command shell or other program. It appends a newline to the result of the expression then stacks or &amp;quot;pushes&amp;quot; it into the STDIN stream. Stacked lines are placed in the stream in &amp;quot;last-in, first-out&amp;quot; order and are available to be read just as though they had been entered interactively. For example, after issuing the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
PUSH line 1&lt;br /&gt;
PUSH line 2&lt;br /&gt;
PUSH line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the stream would be read in the order line 3, line 2, and line 1.&lt;br /&gt;
&lt;br /&gt;
PUSH allows the STDIN stream to be used as a private scratch pad to prepare data for subsequent processing. For example, several files could be concatenated with delimiters between them by simply reading the input files, PUSHing the line into the stream and inserting a delimiter where required. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   PUSH &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== QUEUE ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;QUEUE [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The QUEUE instruction is used to prepare a stream of data to be read by a command shell or other program. It is very similar to the PUSH instruction and differs only in that the data lines are placed in the STDIN stream in &amp;quot;first-in, first-out&amp;quot; order. In this case, the instructions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
QUEUE line 1&lt;br /&gt;
QUEUE line 2&lt;br /&gt;
QUEUE line 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would be read in the order line 1, line 2, and line 3. The QUEUEd lines always precede all interactively-entered lines and always follow any PUSHed (stacked) lines. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DO i=1 to 5&lt;br /&gt;
   QUEUE &#039;echo &amp;quot;Line &#039;i&#039;&amp;quot;&#039;&lt;br /&gt;
   END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== RETURN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;RETURN [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RETURN is used to leave a function and return control to the point of the function&#039;s invocation. The evaluated expression is returned as the function result. If an expression is not supplied, an error may result in the caller&#039;s environment. Functions called from within an expression must return a result string and will generate an error if no result is available. Functions invoked by the CALL instruction need to return a result.&lt;br /&gt;
&lt;br /&gt;
A RETURN issued from the base environment of a program is not an error and is equivalent to an EXIT instruction. Refer to the EXIT instruction for a description of how result strings are passed back to an external caller. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
RETURN 6*7 /*Returns 42*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SAY ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SAY [expression]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result of the evaluated expressions is written to the output console, with a newline character appended. If the expression is omitted, a null string is sent to the console. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY &#039;The answer is &#039; value &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SELECT ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SELECT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT begins a group of instructions containing one or more WHEN clauses and possibly a single OTHERWISE clause, each followed by a conditional statement. Only one of the conditional statements within the SELECT group will be executed. Each WHEN statement is executed in succession until one succeeds. If none succeeds, the OTHERWISE statement is executed. The SELECT range must be terminated by an END statement. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i=1 THEN SAY &#039;one&#039;&lt;br /&gt;
   WHEN i=2 THEN SAY &#039;two&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;other&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SHELL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SHELL [symbol | string | [[VALUE] [expression]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The SHELL instruction is a synonym for the ADDRESS instruction. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SHELL edit /*Set host to `EDIT&#039;*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SIGNAL ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;SIGNAL {ON | OFF} condition SIGNAL [VALUE] expression&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SIGNAL {ON | OFF} controls the state of the internal interrupt flags. Interrupts allow a program to detect and retain control when certain errors occur. In this form SIGNAL must be followed by one of the keywords ON or OFF and one of the condition keywords listed below. The interrupt flag specified by the condition symbol is then set to the indicated state. The valid signal conditions are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;BREAK_C&#039;&#039;&#039; || A Ctrl+C break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_D&#039;&#039;&#039; || A Ctrl+D break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_E&#039;&#039;&#039; || A Ctrl+E break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;BREAK_F&#039;&#039;&#039; || A Ctrl+F break was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ERROR&#039;&#039;&#039; || A host command returned a non-zero code.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;HALT&#039;&#039;&#039; || An external HALT request was detected.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IOERR&#039;&#039;&#039; || An error was detected by the I/O system.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;NOVALUE&#039;&#039;&#039; || An uninitialized variable was used.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SYNTAX&#039;&#039;&#039; || A syntax or execution error was detected.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The condition keywords are interpreted as labels to which control will be transferred if the selected condition occurs. For example, if the ERROR interrupt is enabled and a command returns a non-zero code, ARexx will transfer control to the label ERROR:. The condition label must be defined in the program; otherwise, an immediate SYNTAX error results and the program exits.&lt;br /&gt;
&lt;br /&gt;
In SIGNAL [VALUE] expression, the tokens following SIGNAL are evaluated as an expression. An immediate interrupt is generated that transfers control to the label specified by the expression result. The instruction thus acts as a &amp;quot;computed goto&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Whenever an interrupt occurs, all currently active control ranges (IF, DO, SELECT, INTERPRET, or interactive TRACE) are dismantled before the transfer of control. Thus, the transfer cannot be used to jump into the range of a DO loop or other control structure. Only the control structures in the current environment are affected by a SIGNAL condition, making it safe to SIGNAL from within an internal function without affecting the state of the caller&#039;s environment.&lt;br /&gt;
&lt;br /&gt;
The special variable SIGL is set to the current line number whenever a transfer of control occurs. The program can inspect SIGL to determine which line was being executed before the transfer. If an ERROR or SYNTAX condition causes an interrupt, the special variable RC is set to the error code that triggered the interrupt. For the ERROR condition, this code is usually an error severity level. Refer to Appendix A for further details on error codes and severity levels. The SYNTAX condition will always indicate an ARexx error code. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SIGNAL on error /*Enable interrupt*/&lt;br /&gt;
SIGNAL off syntax /*Disable SYNTAX*/&lt;br /&gt;
SIGNAL start /*Goto START*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== WHEN ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;WHEN expression [THEN [;] [conditional statement]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The WHEN instruction is similar to the IF instruction, but is valid only within a SELECT range. Each WHEN expression is evaluated in turn and must result in a Boolean value. If the result is a 1, the conditional statement is executed and control passes to the END statement that terminates the SELECT. As with the IF instruction, the THEN need not be part of the same clause. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
   WHEN i&amp;lt;j THEN SAY &#039;less&#039;&lt;br /&gt;
   WHEN i=j THEN SAY &#039;equal&#039;&lt;br /&gt;
   OTHERWISE SAY &#039;greater&#039;&lt;br /&gt;
   END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Elements_of_ARexx&amp;diff=6851</id>
		<title>AmigaOS Manual: ARexx Elements of ARexx</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Elements_of_ARexx&amp;diff=6851"/>
		<updated>2014-01-25T10:14:00Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos, missing text in last para.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter introduces the rules and concepts that make up the ARexx programming language and explains how ARexx interprets the characters and words used in programs. The different elements that are explained include:&lt;br /&gt;
&lt;br /&gt;
* Tokens - the smallest element of the ARexx language&lt;br /&gt;
* Clauses - the smallest executable unit, similar to a sentence&lt;br /&gt;
* Expressions - a group of evaluated tokens&lt;br /&gt;
* The Command Interface - the process by which ARexx programs communicate with ARexx-compatible applications&lt;br /&gt;
&lt;br /&gt;
This chapter also includes a discussion of the ARexx execution environment. This is intended for more advanced Amiga users and includes technical details on interprocess communication.&lt;br /&gt;
&lt;br /&gt;
= Tokens =&lt;br /&gt;
&lt;br /&gt;
Tokens, the smallest distinct entities of the ARexx language, may be a single character or a series of characters. There are five categories of tokens:&lt;br /&gt;
&lt;br /&gt;
* comments&lt;br /&gt;
* symbols&lt;br /&gt;
* strings&lt;br /&gt;
* operators&lt;br /&gt;
* special characters&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
A comment is any group of characters beginning with the sequence /* (slash asterisk) and ending with */ (asterisk slash). Each ARexx program must begin with a comment. Each /* must have a matching */ . For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*This is an ARexx comment*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Comments may be placed anywhere in a program and can even be nested within one another. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A /*nested*/ comment*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Insert comments throughout your program. Comments remind you and others of the program&#039;s intentions. Because the interpreter ignores comments when it scans your programs, comments do not slow down the execution of your program.&lt;br /&gt;
&lt;br /&gt;
== Symbols ==&lt;br /&gt;
&lt;br /&gt;
A symbol is any group of the characters a-z, A-Z, 0-9, and period (.), exclamation point (!), question mark (?), dollar sign ($), and underscore (_). Symbols are translated to uppercase as the interpreter scans the program, so the symbol MyName is equivalent to MYNAME. The four types of recognized symbols are:&lt;br /&gt;
&lt;br /&gt;
; Fixed symbols&lt;br /&gt;
: A series of numeric characters that begins with a digit (0-9) or a period (.). The value of a fixed symbol is always the symbol name itself, translated to uppercase. 12345 is an example of a fixed symbol.&lt;br /&gt;
&lt;br /&gt;
; Simple symbols&lt;br /&gt;
: A series of alphabetic characters that begins with a letter A-Z. &amp;quot;MyName&amp;quot; is an example of a simple symbol.&lt;br /&gt;
&lt;br /&gt;
; Stem symbols&lt;br /&gt;
: A series of alphanumeric characters that ends with one period. &amp;quot;A.&amp;quot; and &amp;quot;Stem9.&amp;quot; Are examples of stem symbols.&lt;br /&gt;
&lt;br /&gt;
; Compound symbols&lt;br /&gt;
: A series of alphanumeric characters that includes one or more periods within the characters. &amp;quot;A.1.Index&amp;quot; is an example of a compound symbol.&lt;br /&gt;
&lt;br /&gt;
Simple, stem, and compound symbols are called variables and may be assigned a value during the course of the program execution. If a variable has not yet been assigned a value, it is uninitialized. The value for an uninitialized variable is the variable name itself (translated to uppercase, if applicable).&lt;br /&gt;
&lt;br /&gt;
Stems and compound symbols have special properties that make them useful for building arrays and lists. Stem symbols provide a way to initialize a whole class of compound symbols. A compound symbol can be regarded as having the structure stem.n1.n2...nk, where the leading name is a stem symbol and each node, n1...nk, is a fixed or simple symbol.&lt;br /&gt;
&lt;br /&gt;
When an assignment is made to a stem symbol, it assigns that value to all possible compound symbols derived from the stem. Thus, the value of a compound symbol depends on the prior assignments made to itself or its associated stem.&lt;br /&gt;
&lt;br /&gt;
Whenever a compound symbol appears in a program, its name is expanded by replacing each node with its current value. The value string may consist of any characters, including embedded blanks, and will not be converted to uppercase. The result of the expansion is a new name that is used in place of the compound symbol. For example, if J has the value 3 and K has the value 7, then the compound symbol A.J.K will expand to A.3.7.&lt;br /&gt;
&lt;br /&gt;
Compound symbols can be regarded as a form of associative or content-addressable memory. For example, suppose that you needed to store and retrieve a set of names and telephone numbers. The conventional approach would be to set up two arrays, NAME and NUMBER, each indexed by an integer running from one to the number of entries. A number would be looked up by scanning the name array until the given name was found, say in NAME.12, and then retrieving NUMBER.12. With compound symbols, the symbol NAME could hold the name to be retrieved, and NUMBER.NAME would then expand to the corresponding number, for example, NUMBER.CBM.&lt;br /&gt;
&lt;br /&gt;
Compound symbols can also be used as conventional indexed arrays, with the added convenience that only a single assignment (to the stem) is required to initialize the entire array.&lt;br /&gt;
&lt;br /&gt;
For instance, the program below uses the stems &amp;quot;number.&amp;quot; and &amp;quot;addr.&amp;quot; to create a computerized telephone directory.&lt;br /&gt;
&lt;br /&gt;
=== Program 8. Phone.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A telephone book to show compound variables.*/&lt;br /&gt;
IF ARG () ~ = 1 THEN DO&lt;br /&gt;
SAY &amp;quot;USAGE: rx phone name&amp;quot;&lt;br /&gt;
EXIT 5&lt;br /&gt;
END&lt;br /&gt;
/*Open window to display phone nos/addresses.*/&lt;br /&gt;
CALL OPEN out, &amp;quot;con:0/0/640/60/ARexx Phonebook&amp;quot;&lt;br /&gt;
IF ~ result THEN DO&lt;br /&gt;
SAY &amp;quot;Open failure ... sorry&amp;quot;&lt;br /&gt;
EXIT 10&lt;br /&gt;
END&lt;br /&gt;
/*Number definitions*/&lt;br /&gt;
number. = `(not found)&#039;&lt;br /&gt;
number.wsh = `(555) 001-0001&#039;&lt;br /&gt;
addr. = `(not found)&#039;&lt;br /&gt;
number.CBM = `(555) 002-0002&#039;&lt;br /&gt;
addr.CBM = `1200 Wilson Dr., West Chester, PA, 19380&#039;&lt;br /&gt;
/*(Work is done here)*/&lt;br /&gt;
ARG name /*The name*/&lt;br /&gt;
CALLWRITELN out, name | | &amp;quot; `s number is&amp;quot; number.name&lt;br /&gt;
CALL WRITELN out,name | | &amp;quot; `s address is&amp;quot; addr.name&lt;br /&gt;
CALL WRITELN out, &amp;quot;Press Return to exit.&amp;quot;&lt;br /&gt;
CALL READLN out&lt;br /&gt;
EXIT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute the program, activate a Shell window and enter:&lt;br /&gt;
&lt;br /&gt;
 RX Phone cbm&lt;br /&gt;
&lt;br /&gt;
A window will display the name and address assigned to CBM.&lt;br /&gt;
&lt;br /&gt;
== Strings ==&lt;br /&gt;
&lt;br /&gt;
A string is any group of characters beginning and ending with a quote (&#039;) or double quote (&amp;quot;) delimiter. The same delimiter must be used at both ends of the string. To include the delimiter character in the string, use a double-delimiter sequence (&#039;&#039; or &amp;quot;&amp;quot;). For example:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Now is the time.&amp;quot; An example of a normal string.&lt;br /&gt;
&lt;br /&gt;
&#039;Can&#039;&#039;t you see?&#039; An example of a string using a double-delimiter sequence.&lt;br /&gt;
&lt;br /&gt;
The value of a string is the string itself. The number of characters in the string is called its length. If the string does not contain any characters, it is called a null string.&lt;br /&gt;
&lt;br /&gt;
Strings that are followed by an X or B character are classified as hex or binary strings, respectively, and must be composed of hexadecimal digits (0-9, A-F) or binary digits (0,1). For example:&lt;br /&gt;
&lt;br /&gt;
 &#039;4A 3B C0&#039;X&lt;br /&gt;
 &#039;00110111&#039;B&lt;br /&gt;
&lt;br /&gt;
Blanks are permitted at byte boundaries to improve readability. Hex and binary strings are convenient for specifying non-ASCII characters and machine-specific information, like addresses. They are converted immediately to the packed (machine-compressed) internal form.&lt;br /&gt;
&lt;br /&gt;
== Operators ==&lt;br /&gt;
&lt;br /&gt;
Operators are a combination of the following characters: ~ + - * / = &amp;gt; &amp;lt; &amp;amp; | ^, as explained in this section. There are four types of operators:&lt;br /&gt;
&lt;br /&gt;
* Arithmetic operators require one or two numeric operands and produce a numeric result.&lt;br /&gt;
* Concatenation operators join two strings into a single string.&lt;br /&gt;
* Comparison operators require two operands and produce a Boolean (0 or 1) result.&lt;br /&gt;
* Logical operators require one or two Boolean operands and produce a Boolean result.&lt;br /&gt;
&lt;br /&gt;
Each operator has an associated priority that determines the order in which operations will be performed in an expression. Operators with higher priorities (8) are performed before those with lower priorities (1).&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic Operators ===&lt;br /&gt;
&lt;br /&gt;
An important class of operands is that representing numbers. Numbers consist of the characters 0-9, a period (.), plus sign (+), minus sign (-), and blanks. To indicate exponential notation, a number may be followed by an &amp;quot;e&amp;quot; or &amp;quot;E&amp;quot; and a (signed) integer.&lt;br /&gt;
&lt;br /&gt;
Both strings and symbols may be used to specify numbers. Since the language is typeless, variables do not have to be declared as numeric before use in an arithmetic operation. Instead, each value string is examined when it is used in order to verify that it represents a number. The following examples are all valid numbers:&lt;br /&gt;
&lt;br /&gt;
 33&lt;br /&gt;
 &amp;quot; 12.3 &amp;quot;&lt;br /&gt;
 0.321e12&lt;br /&gt;
 ` + 15. `&lt;br /&gt;
&lt;br /&gt;
Leading and trailing blanks are permitted. Blanks may be embedded between a plus (+) or minus (-) sign and the number, but not within the number itself.&lt;br /&gt;
&lt;br /&gt;
You can modify the basic precision used for arithmetic calculations while a program is executing. The number of significant figures used in arithmetic operations is determined by the Numeric Digits setting and may be modified using the NUMERIC instruction described in Chapter 4.&lt;br /&gt;
&lt;br /&gt;
The number of decimal places used for a result depends on the operation and the number of decimal places in the operands. ARexx preserves trailing zeroes to indicate the precision of the result. If the total number of digits required to express a value exceeds the current Numeric Digits setting, the number is formatted in exponential notation. They are:&lt;br /&gt;
&lt;br /&gt;
* Scientific notation - the exponent is adjusted so that a single digit is placed to the left of the decimal point.&lt;br /&gt;
* Engineering notation - the number is scaled so that the exponent is a multiple of 3 and the digits to the left of the decimal point range from 1 to 999.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-1. Arithmetic Operators&lt;br /&gt;
! Operator !! Priority !! Example !! Result&lt;br /&gt;
|-&lt;br /&gt;
| + (prefix conversion) || 8 || &#039;3.12&#039; || 3.12&lt;br /&gt;
|-&lt;br /&gt;
| - (prefix negation) || 8 || -&amp;quot;3.12&amp;quot; || -3.12&lt;br /&gt;
|-&lt;br /&gt;
| ** (exponentiation) || 7 || 0.5**3 || 0.125&lt;br /&gt;
|-&lt;br /&gt;
| * (multiplication) || 6 || 1.5*1.50 || 2.250&lt;br /&gt;
|-&lt;br /&gt;
| / (division) || 6 || 6 / 3 || 2&lt;br /&gt;
|-&lt;br /&gt;
| % (integer division) || 6 || -8 % 3 || -2&lt;br /&gt;
|-&lt;br /&gt;
| // (remainder) || 6 || 5.1//0.2 || 7.15&lt;br /&gt;
|-&lt;br /&gt;
| + (addition) || 5 || 3.1+4.05 || 7.15&lt;br /&gt;
|-&lt;br /&gt;
| - (subtraction) || 5 || 5.55 - 1 || 4.55 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Concatenation Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx defines two concatenation operators. The first, identified by the operator sequence || (two vertical bars), joins two strings into a single string with no intervening blank. This type of concatenation can also be specified implicitly. When a symbol and a string are typed without any intervening spaces, ARexx behaves as if the || operator had been specified. The second concatenation operation is identified by the blank operator and joins the two operand strings with one intervening blank.&lt;br /&gt;
&lt;br /&gt;
The priority of all concatenation operations is 4. Table 3-2 summarizes the different operations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-2. Concatenation Operators&lt;br /&gt;
! Operator !! Operation !! Example !! Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt; || Concatenation || &#039;why me, &#039;&amp;lt;nowiki&amp;gt;||&amp;lt;/nowiki&amp;gt;&#039;Mom?&#039; || why me, Mom?&lt;br /&gt;
|-&lt;br /&gt;
| Blank || Blank Concatenation || &#039;good&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;times&#039; || good times&lt;br /&gt;
|-&lt;br /&gt;
| none || Implied Concatenation || one&#039;two&#039;three || ONEtwoTHREE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Comparison Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx supports three types of comparisons:&lt;br /&gt;
&lt;br /&gt;
* Exact comparisons - character-by-character comparison.&lt;br /&gt;
* String comparisons - ignore leading blanks and add blanks to the shorter string.&lt;br /&gt;
* Numeric comparisons - convert the operands to an internal numeric form using the current Numeric Digits setting and then run an arithmetic comparison.&lt;br /&gt;
&lt;br /&gt;
Comparisons always result in a Boolean value. The numbers 0 and 1 are used to represent the Boolean values false and true. The use of a value other than 0 or 1 when a Boolean operand is expected will generate an error. Any number equivalent to 0 or 1, for example 0.000 or 0.1E1, is also acceptable as a Boolean value.&lt;br /&gt;
&lt;br /&gt;
Except for the exact equality (==) and exact inequality (~==) operators, all comparison operators dynamically determine whether a string or numeric comparison is to be performed. A numeric comparison is performed if both operands are valid numbers. Otherwise, the operands are compared as strings.&lt;br /&gt;
&lt;br /&gt;
All comparisons have a priority of 3. Table 3-3 lists the acceptable comparison operators.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-3. Comparison Operators&lt;br /&gt;
! Operator !! Operation !! Mode&lt;br /&gt;
|-&lt;br /&gt;
| == || Exact Equality || Exact&lt;br /&gt;
|-&lt;br /&gt;
| ~== || Exact Inequality || Exact&lt;br /&gt;
|-&lt;br /&gt;
| = || Equality || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| ~= || Inequality || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Greater Than || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= or ~&amp;lt; || Greater Than or Equal To || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; || Less Than || String/Numeric&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= or ~&amp;gt; || Less Than or Equal To || String/Numeric&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical (Boolean) Operators ===&lt;br /&gt;
&lt;br /&gt;
ARexx defines the four logical operations, NOT, AND, OR, and Exclusive OR, all of which require Boolean operands and produce a Boolean result. An attempt to perform a logical operation on a non-Boolean operand will generate an error. Table 3-4 shows the acceptable logical operators.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-4. Logical Operators&lt;br /&gt;
! Operator !! Priority !! Operation&lt;br /&gt;
|-&lt;br /&gt;
| ~ || 8 || NOT (Inversion)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp; || 2 || AND&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; || 1 || OR&lt;br /&gt;
|-&lt;br /&gt;
| ^or &amp;amp;&amp;amp; || 1 || Exclusive OR&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special Characters ==&lt;br /&gt;
&lt;br /&gt;
A few punctuation characters have special meanings within ARexx, as shown in Table 3-5.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 3-5. Special Characters&lt;br /&gt;
! Special Character !! Definition &lt;br /&gt;
|-&lt;br /&gt;
| (:) Colon&lt;br /&gt;
| A colon defines a label when preceded by a symbol token (any alphanumeric character or . ! ? $).&lt;br /&gt;
|-&lt;br /&gt;
| ( ) Parentheses&lt;br /&gt;
| Parentheses are used to group operators and operands into subexpressions to override the normal operator priorities. An open parenthesis also serves to identify a function call within an expression. A Symbol or string followed immediately by an open parenthesis defines a function name. Parentheses must always be matched within a statement.&lt;br /&gt;
|-&lt;br /&gt;
| (;) Semicolon&lt;br /&gt;
| A semicolon acts as a statement terminator. Several statements that fit on one line may be separated by semicolons.&lt;br /&gt;
|-&lt;br /&gt;
| (,) Comma&lt;br /&gt;
| A comma acts as the continuation character for statements broken into several lines and as a separator of argument expressions in a function call.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Clauses =&lt;br /&gt;
&lt;br /&gt;
Clauses, the smallest language unit that can be executed as a statement, are formed from token groupings.&lt;br /&gt;
&lt;br /&gt;
As the program is read, the language interpreter splits the program into groups of clauses. These groups of one or more clauses are then broken down into tokens and each clause is classified as a particular type. Seemingly small syntactic differences may completely change the semantic content of a statement. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
SAY &#039;Hello, Bill&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is an instruction clause and will display &amp;quot;Hello, Bill&amp;quot; on the console, but:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;SAY &#039;Hello, Bill&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is a command clause, and will issue &amp;quot;SAY Hello, Bill&amp;quot; as a command to an external program. The presence of the leading null string (&#039;&#039;) changes the classification from an instruction clause to a command clause.&lt;br /&gt;
&lt;br /&gt;
The end of a line normally acts as the implicit end of a clause. A clause can be continued on the next line by ending the line with a comma. The comma is ignored by the program, and the next line is considered as a continuation of the clause. There is no limit to the number of continuations that may occur (except for those limits imposed by the command buffer).&lt;br /&gt;
&lt;br /&gt;
String and comment tokens are automatically continued if a line ends before the closing delimiter has been found, and the newline (i.e., Enter) character is not considered to be part of the token.&lt;br /&gt;
&lt;br /&gt;
== Null Clauses ==&lt;br /&gt;
&lt;br /&gt;
Null clauses are lines of blanks or comments and may appear anywhere in a program. They have no function in the execution of a program, except to aid its readability and to increment the line count.&lt;br /&gt;
&lt;br /&gt;
== Label Clauses ==&lt;br /&gt;
&lt;br /&gt;
A label clause is a symbol followed by a colon (:). A label acts as a place marker in the program, but no action occurs with the execution of a label. The colon is considered as an implicit clause terminator, so each label stands as a separate clause. Label clauses may appear anywhere in a program. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
start: /*Begin execution*/&lt;br /&gt;
syntax: /*Error processing*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assignment Clauses ==&lt;br /&gt;
&lt;br /&gt;
Assignment clauses are identified by a variable symbol followed by an = operator. (In this context the = operator&#039;s normal definition of equality comparison is overridden.) The tokens to the right of the = are evaluated as an expression and the result is assigned to the variable. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
When = &#039;Now is the time&#039;&lt;br /&gt;
answ = 3.14 * fact(5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equal sign (=) assigns the value &#039;Now is the time&#039; to the variable &#039;when&#039;, and assigns the result of 3.14 * fact(5) to the variable &#039;answ&#039;.&lt;br /&gt;
&lt;br /&gt;
== Instruction Clauses ==&lt;br /&gt;
&lt;br /&gt;
Instruction clauses begin with the name of the instruction and tell ARexx to perform an action. Instruction names are described in Chapter 4. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
DROP a b c&lt;br /&gt;
SAY &#039;please&#039;&lt;br /&gt;
IF j &amp;gt; 5 THEN LEAVE; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command Clauses ==&lt;br /&gt;
&lt;br /&gt;
Command clauses are any ARexx expression that cannot be classified as one of the preceding types of clauses. The expression is evaluated and the result is issued as a command to an external host. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;delete&#039; &#039;myfile&#039; /*AmigaDOS command*/&lt;br /&gt;
&#039;jump&#039; current+10 /*An editor command*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The delete command is not recognized as an ARexx command, so it is sent to the external host, in this case AmigaDOS. The jump command in the second example is assumed to be understood by an external text editor.&lt;br /&gt;
&lt;br /&gt;
= Expressions =&lt;br /&gt;
&lt;br /&gt;
Expressions are a group of evaluated tokens. Most statements contain at least one expression. Expressions are composed of:&lt;br /&gt;
&lt;br /&gt;
* Strings - The value of a string is the string itself.&lt;br /&gt;
* Symbols - The value of a fixed symbol is the symbol itself, translated to uppercase. Symbols may be used as variables and may have an assigned value.&lt;br /&gt;
* Operators - An operator has a priority order that determines when it will be performed.&lt;br /&gt;
* Parentheses - Parentheses may be used to alter the normal order of evaluation in the expression or to identify function calls. A symbol or string followed immediately by an open parenthesis defines the function name, and the tokens between the opening and closing parenthesis form the argument list for the function. For example, the expression:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
J &#039;factorial is&#039; fact (J)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is composed of:&lt;br /&gt;
&lt;br /&gt;
* a symbol - J&lt;br /&gt;
* a blank operator&lt;br /&gt;
* a string - factorial is&lt;br /&gt;
* another blank&lt;br /&gt;
* a symbol - fact&lt;br /&gt;
* an open parenthesis&lt;br /&gt;
* a symbol - J&lt;br /&gt;
* a closing parenthesis&lt;br /&gt;
&lt;br /&gt;
In this example, FACT is a function name and (J) is its argument list, the single expression J.&lt;br /&gt;
&lt;br /&gt;
Before the evaluation of an expression proceeds, ARexx must obtain a value for each symbol in the expression. For fixed symbols the value is the symbol name itself, but variable symbols must be looked up in the current symbol table. In the example above, if the symbol J was assigned the value 3, the expression after symbol resolution would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
3 &#039;factorial is&#039; FACT (3)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To avoid ambiguities in the values assigned to symbols during the resolution process, ARexx guarantees a strict left-to-right resolution order. Symbol resolution proceeds irrespective of operator priority or parenthetical grouping. If a function call is found, the resolution is suspended while the function is evaluated. It is possible for the same symbol to have more than one value in an expression.&lt;br /&gt;
&lt;br /&gt;
If the previous example was rearranged to read:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
FACT(J) &#039;is&#039; J &#039;factorial&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would the second occurrence of symbol J still resolve to 3? In general, function calls may have side effects that include altering the values of variables. If the example was rearranged, the value of J might have been changed by the call to FACT.&lt;br /&gt;
&lt;br /&gt;
After all symbol values have been resolved, the expression is evaluated based on operator priority and subexpression grouping. ARexx does not guarantee an order of evaluation among operators of equal priority and does not employ a &amp;quot;fast path&amp;quot; evaluation of Boolean operations. For example, in the expression:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
(1 = 2) &amp;amp; (FACT(3) = 6)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the call to the FACT function will be made even though the first term of the AND (&amp;amp;) operation is 0. This example points out that ARexx will continue reading left to right, even though the given example is false and will return a value of 0.&lt;br /&gt;
&lt;br /&gt;
= The Command Interface =&lt;br /&gt;
&lt;br /&gt;
The ARexx command interface is a public message port. ARexx compatible applications must have this message port. ARexx programs issue commands by placing the command string in a message packet and sending the packet to the host&#039;s message port. The program suspends operation while the host processes the commands and resumes when the message packet returns.&lt;br /&gt;
&lt;br /&gt;
== The Host Address ==&lt;br /&gt;
&lt;br /&gt;
ARexx maintains two implicit host addresses, a current and a previous value, as part of the program&#039;s storage environment. These values can be changed at any time using the ADDRESS instruction (or its synonym, SHELL). The current host address can be inspected with the ADDRESS() built-in function. The default host address string is REXX, but this can be overridden when a program is invoked. Most host applications will supply the name of their public port when they invoke a macro program, so that the macro can automatically issue commands back to the host.&lt;br /&gt;
&lt;br /&gt;
One special host address is recognized. The string COMMAND indicates that the macro should be issued directly to AmigaDOS. All other host addresses are assumed to refer to a public message port. An attempts to send a command to a nonexistent message port will generate the syntax error &amp;quot;Host environment not found&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Program 9 shows the interaction between ARexx and the AmigaDOS editor, ED. The program sees if ED is running, determines the name of the message port, and sets up some stem variables.&lt;br /&gt;
&lt;br /&gt;
=== Program 9. ED-status.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Prints status of ED. ED must be running before this program is started. ED ports are named &#039;Ed&#039;, &#039;Ed_1&#039;, &#039;Ed_2&#039;, and so on.*/&lt;br /&gt;
DEFAULT_ED = &amp;quot;Ed &amp;quot;/*This name is case sensitive*/&lt;br /&gt;
/*Procedure to follow if ED isn&#039;t running, or if only a second (or later) instance of ED is running.*/&lt;br /&gt;
DO WHILE ~ SHOW (&#039;p&#039;,DEFAULT_ED) /*Look for port*/&lt;br /&gt;
SAY &amp;quot;Cannot find port named&amp;quot; DEFAULT_ED&lt;br /&gt;
SAY &amp;quot;Available ports:&amp;quot;&lt;br /&gt;
SAY SHOW (&#039;P&#039;) &#039;0a&#039;X&lt;br /&gt;
SAY &amp;quot;Enter different name for port, or QUIT to quit &amp;quot;/*Let user choose port if we can&#039;t find it*/&lt;br /&gt;
DEFAULT_ED = READLN(stdout)IF STRIP(UPPER(DEFAULT_ED)) = &#039;QUIT&#039; then exit 10 /*Let user quit*/&lt;br /&gt;
END&lt;br /&gt;
SAY &amp;quot;Using ED port&amp;quot; DEFAULT_ED&lt;br /&gt;
/*Now that port is found, have ARexx address it.*/&lt;br /&gt;
ADDRESS VALUE DEFAULT_ED&lt;br /&gt;
/* Set up some useful stem variables*/&lt;br /&gt;
STEM.0 = 15 /*Number of ED ARexx variables*/&lt;br /&gt;
STEM.1 = &#039;LEFT&#039; /*Left margin (SL)*/&lt;br /&gt;
STEM.2 = &#039;RIGHT&#039; /*Right margin (SR)*/&lt;br /&gt;
STEM.3 = &#039;TABSTOP&#039; /*Tab stop setting (ST)*/&lt;br /&gt;
STEM.4 = &#039;LMAX&#039; /*Max visible line on screen*/&lt;br /&gt;
STEM.5 = &#039;WIDTH&#039; /*Width of screen in chars*/&lt;br /&gt;
STEM.6 = &#039;X&#039; /*Physical X pos. on screen-from 1*/&lt;br /&gt;
STEM.7 = &#039;Y&#039; /*Physical Y pos. on screen-from 1*/&lt;br /&gt;
STEM.8 = &#039;BASE&#039; /*Window base*/&lt;br /&gt;
/*Base is 0 unless screen is shifted right)*/&lt;br /&gt;
STEM.9 = &#039;EXTEND&#039; /*Extended margin value (EX)*/&lt;br /&gt;
STEM.10 = &#039;FORCECASE&#039; /*Case sensitivity flag*/&lt;br /&gt;
STEM.11 = &#039;LINE&#039; /*Current line number*/&lt;br /&gt;
STEM.12 = &#039;FILENAME&#039; /*File being edited*/&lt;br /&gt;
STEM.13 = &#039;CURRENT&#039; /*Text of current line*/&lt;br /&gt;
STEM.14 = &#039;LASTCMD&#039; /*Last extended command*/&lt;br /&gt;
STEM.15 = &#039;SEARCH&#039; /*Last search string*/&lt;br /&gt;
/*Ask ED to put values into stem variable &#039;STEM.&#039;*/&lt;br /&gt;
&#039;RV&#039; &#039;/STEM/&#039; /*RV is an ED command used to send into from ED to ARexx*/&lt;br /&gt;
/*STEM.1 is LEFT, and STEM.LEFT now holds a value from ED. Here is a way to print that information.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to STEM.0&lt;br /&gt;
   ED_VAR = STEM.1&lt;br /&gt;
   SAY STEM.1 &amp;quot;=&amp;quot; STEM.ED_VAR /*Print ED variable/value*/&lt;br /&gt;
END &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating a Macro ==&lt;br /&gt;
&lt;br /&gt;
ARexx can be used to write programs for any host application that includes a compatible command interface. Some application programs are designed with an embedded macro language and may include many pre-defined macro commands.&lt;br /&gt;
&lt;br /&gt;
Check your macro program for &amp;quot;shortcut&amp;quot; commands. Some programs may include powerful functions that were implemented specifically for use in macro programs.&lt;br /&gt;
&lt;br /&gt;
The interpretation of the received commands depends entirely on the host application. In the simplest case, the command strings will correspond exactly to commands that could be entered directly by a user. For example, positional control (up/down) commands for a text editor would probably have identical interpretations. Other commands may be valid only when issued from a macro program. A command to simulate a menu operation would probably not be entered by the user. In Program 10, the ARexx program is called by ED to transpose two characters.&lt;br /&gt;
&lt;br /&gt;
=== Program 10. Transpose.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Given string `123&#039;, if cursor is on 3, macro converts string to `213&#039;.*/&lt;br /&gt;
HOST = ADDRESS() /*Find out which ED called us*/&lt;br /&gt;
ADDRESS VALUE HOST /*. . . and talk to it.*/&lt;br /&gt;
`rv&#039; `/CURR/&#039; /*Have ED put info in stem CURR*/&lt;br /&gt;
/*We&#039;ll need two pieces of informations:*/&lt;br /&gt;
currpos = CURR.X /*Position of cursor on line*/&lt;br /&gt;
currling = CURR.CURRENT /*Contents of current line*/&lt;br /&gt;
IF (currpos &amp;gt;2) /*Must work on current line*/&lt;br /&gt;
THEN currpos = currpos - 1&lt;br /&gt;
ELSE DO /*Report error and exit*/&lt;br /&gt;
`sm /Cursor must be at pos. 2 or more to the right/&#039;&lt;br /&gt;
EXIT 10&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
/*Need to reverse the CURRPOSth and CURRPOSth-1 chars and replace the current line with the new one.*/&lt;br /&gt;
DROP CURR. /*STEM variable CURR is no longer needed; save some memory*/&lt;br /&gt;
`d&#039; /*Tell ED to delete current line*/&lt;br /&gt;
currlin = swapch (currpos,currlin) /*Swap 2 chars*/&lt;br /&gt;
`i /&#039;| |currlin| |&#039;/ /*Insert modified line*/&lt;br /&gt;
DO i = 1 to currpos /*Place cursor back at start*/&lt;br /&gt;
`cr&#039; /*ED&#039;s `cursor right&#039; command*/&lt;br /&gt;
END&lt;br /&gt;
EXIT /*All done*/&lt;br /&gt;
/*Function to swap two characters*/&lt;br /&gt;
swapch: procedure&lt;br /&gt;
PARSE ARG cpos,clin&lt;br /&gt;
chl = substr (clin, cpos, 1) /*Get character*/&lt;br /&gt;
clin = delstr (clin, cpos, 1) /*Delete it from string*/&lt;br /&gt;
clin = insert (chl,clin,cpos-2,1) /*Insert to create transposition*/&lt;br /&gt;
RETURN clin /*Return modified string*/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To execute this example from ED, press ESC then enter:&lt;br /&gt;
&lt;br /&gt;
 RX &amp;quot;transpose.rexx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can also assign this string to a function key.&lt;br /&gt;
&lt;br /&gt;
== Return Codes ==&lt;br /&gt;
&lt;br /&gt;
After it finishes processing a command, the host replies with a return code to indicate the status of the command. The documentation for the host application should describe the possible return codes for each command. These codes can be used to determine whether the operation performed by the command was successful.&lt;br /&gt;
&lt;br /&gt;
This return code is placed in the ARexx special variable RC so that it can be examined by the macro. A value of zero means that the command was successful. A return of a positive integer indicates an error condition. The higher the integer, the more severe the error. The return code allows the macro program to determine whether the command succeeded and to take action if it failed.&lt;br /&gt;
&lt;br /&gt;
== Command Shells ==&lt;br /&gt;
&lt;br /&gt;
Although ARexx was designed to work most effectively with programs that support its specific command interface, it can be used with any command shell program that uses standard I/O mechanisms to obtain its input stream. One way to use ARexx is to create an actual command file on the Ram Disk, then pass it directly to the Shell. Program 11 opens a new Shell to run a standard EXECUTE script.&lt;br /&gt;
&lt;br /&gt;
=== Program 11. Shell.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Launch a new Shell*/&lt;br /&gt;
ADDRESS command&lt;br /&gt;
conwindow = &amp;quot;CON:0/0/640/100/NewOne/Close&amp;quot;&lt;br /&gt;
/*Create a command file*/&lt;br /&gt;
CALL OPEN out, &amp;quot;ram:temp&amp;quot;,write&lt;br /&gt;
CALL WRITELN out, &#039;echo &amp;quot;This is a test&amp;quot;&#039;&lt;br /&gt;
CALL CLOSE out&lt;br /&gt;
/*Open the new Shell window*/&lt;br /&gt;
&#039;newshell&#039; conwindow &amp;quot;ram:temp&amp;quot;&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= The Execution Environment =&lt;br /&gt;
&lt;br /&gt;
{{Note|The material in this section is intended for advanced Amiga users. This information assumes a working knowledge of the Amiga operating system and a familiarity with the reference material on this wiki.}}&lt;br /&gt;
&lt;br /&gt;
The ARexx interpreter, RexxMast, provides a uniform execution environment by running each program as a separate process in the Amiga&#039;s multitasking operating system. This allows for a flexible interface between an external host program and RexxMast. The host program can proceed concurrently with its operations or can wait for the interpreted ARexx program to finish. Each ARexx program has both an external and internal environment.&lt;br /&gt;
&lt;br /&gt;
== The External Environment ==&lt;br /&gt;
&lt;br /&gt;
The external environment includes its process structure, input and output streams, and current directory. When each ARexx process is created, it inherits the input and output streams and current directory from its client, the external program that invoked the ARexx program. For example, if an ARexx program was started from a Shell, the ARexx program will inherit the input and output stream and current directory of that Shell. The current directory is used as the starting point in any search for a program or data file. External functions are limited to a maximum of 15 arguments.&lt;br /&gt;
&lt;br /&gt;
== The Internal Environment ==&lt;br /&gt;
&lt;br /&gt;
The internal environment of an ARexx program consists of a static global structure and one or more storage environments. The global data values are fixed (static) at the time the program is invoked. These values include the program source code, static data strings, and argument strings. Once the program is running, these values cannot be changed.&lt;br /&gt;
&lt;br /&gt;
ARexx programs invoked as commands usually have only one argument string, although the command tokenization option may provide more than one. A program invoked as an internal function can have any number of arguments. These arguments persist for the duration of the program.&lt;br /&gt;
&lt;br /&gt;
The storage environment includes the symbol table used for variable values, numeric options, trace options, and host address strings. While the global environment is unique, there may be many storage environments during the course of the program execution. Each time an internal function is called, a new storage environment is activated and initialized. The initial values for most fields are inherited from the previous environment, but values may be changed afterwards without affecting the caller&#039;s environment. The new environment persists until control returns from the function.&lt;br /&gt;
&lt;br /&gt;
Every storage environment includes a symbol table to store the value strings that have been assigned to variables. This symbol table is organized as a two-level binary tree. The primary level stores entries for simple and stem symbols. The secondary level is used for compound symbols. All of the compound symbols associated with a particular stem are stored in one tree, with the entry for the stem being the root of the tree.&lt;br /&gt;
&lt;br /&gt;
Symbols are not entered into the table until an assignment is made to the symbol. Once created, entries at the primary level are never removed, even if the symbol subsequently becomes uninitialized. Secondary trees are released whenever a new assignment is made to the stem associated with that tree.&lt;br /&gt;
&lt;br /&gt;
== Resource Tracking ==&lt;br /&gt;
&lt;br /&gt;
ARexx provides complete tracking for all of the dynamically allocated resources that it uses to execute a program. These resources include memory space, DOS files and related structures, and the message port structure. The tracking system was designed to allow a program to shut down at any point without leaving any resources hanging.&lt;br /&gt;
&lt;br /&gt;
It is possible to go outside of the interpreter&#039;s resource tracking net by making calls directly to the Amiga operating system from within an ARexx program. It is the programmer&#039;s responsibility to trace and return any resources allocated outside of the ARexx resource tracking system. ARexx provides a special interrupt facility so that a program can retain control after an execution error, perform the required cleanup, and exit.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx&amp;diff=6850</id>
		<title>AmigaOS Manual: ARexx</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx&amp;diff=6850"/>
		<updated>2014-01-25T09:14:46Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Welcome =&lt;br /&gt;
&lt;br /&gt;
ARexx, the Amiga counterpart of the IBM REXX programming language, provides the freedom to customize your work environment. It is especially useful as a scripting language which allows you to control and modify applications and to direct how they interact with each other.&lt;br /&gt;
&lt;br /&gt;
This manual introduces you to ARexx, tells you how to create ARexx programs and provides a reference section of ARexx commands.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Introducing ARexx|Chapter 1. Introducing ARexx]] This chapter gives an overview of ARexx, how it works on the Amiga, and the basic features of the programming language.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Getting Started|Chapter 2. Getting Started]] This chapter tells you where to store your ARexx programs, how to execute an ARexx program, and provides several programming examples.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Elements of ARexx|Chapter 3. Elements of ARexx]] This chapter details the rules and concepts that make up the ARexx programming language.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Instructions|Chapter 4. Instructions]] This chapter contains an alphabetical listing of ARexx instructions, which are language statements that dictate an action.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Functions|Chapter 5. Functions]] This chapter describes the use of functions, which are program statements used by ARexx, and provides an alphabetical listing of the built-in ARexx functions.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Debugging|Chapter 6. Debugging]] This chapter focuses on the source-level debugging features used in the development and testing of programs.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Parsing|Chapter 7. Parsing]] This chapter explains how to extract patterns of information from strings.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: Workbench ARexx Port|Chapter 8. WB-ARexx-Port]] This chapter explains how to use the Workbench ARexx port.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Error Messages|Appendix A. Error Messages]] This appendix lists the ARexx error messages.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Command Utilities|Appendix B. Command Utilities]] This appendix lists the ARexx commands that can be run from the Shell.&lt;br /&gt;
&lt;br /&gt;
[[AmigaOS Manual: ARexx Glossary|Glossary]] The glossary contains common ARexx terms.&lt;br /&gt;
&lt;br /&gt;
= Document Conventions =&lt;br /&gt;
&lt;br /&gt;
The following conventions are used in this manual:&lt;br /&gt;
&lt;br /&gt;
; KEYWORDS&lt;br /&gt;
: Keywords are displayed in all uppercase letters, however, the arguments are case-insensitive.&lt;br /&gt;
&lt;br /&gt;
; | (vertical bar)&lt;br /&gt;
: Alternative selections are separated by a vertical bar.&lt;br /&gt;
&lt;br /&gt;
; { } (braces)&lt;br /&gt;
: Required alternatives are enclosed by braces.&lt;br /&gt;
&lt;br /&gt;
; [ ] (brackets)&lt;br /&gt;
: Optional instruction parts are enclosed in brackets.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;n&amp;gt;&lt;br /&gt;
: Variables are displayed in angle brackets. Do not enter the angle brackets when entering the variable.&lt;br /&gt;
&lt;br /&gt;
; Courier&lt;br /&gt;
: Text appearing in the Courier font represents output from your ARexx programs or other information that displays on your screen.&lt;br /&gt;
&lt;br /&gt;
; Key1 + Key2&lt;br /&gt;
: Key combinations displayed with a plus sign (+) connecting them indicates pressing the keys simultaneously.&lt;br /&gt;
&lt;br /&gt;
; Key1, Key2&lt;br /&gt;
: Key combinations displayed with a comma sign (,) separating them indicates pressing the keys in sequence.&lt;br /&gt;
&lt;br /&gt;
; Amiga keys&lt;br /&gt;
: Two keys on the Amiga keyboard used for special functions. The left Amiga key is to the left of the space bar and is marked with a large solid A. The right Amiga key is to the right of the space bar and is an outlined A.&lt;br /&gt;
&lt;br /&gt;
= Sources of Additional Information =&lt;br /&gt;
&lt;br /&gt;
Further information on learning and using ARexx can be found in:&lt;br /&gt;
&lt;br /&gt;
Modern Programming Using REXX , by R.P. O&#039;Hara and D.G. Gomberg, Prentice-Hall, 1985&lt;br /&gt;
&lt;br /&gt;
The REXX Language: A Practical Approach to Programming , by M.F. Cowlishaw, Prentice-Hall, 1985.&lt;br /&gt;
&lt;br /&gt;
Programming in REXX , J. Ranade IBM Series, by Charles Daney.&lt;br /&gt;
&lt;br /&gt;
Using ARexx on the Amiga , by Chris Zamara and Nick Sullivan, Abacus, 1991.&lt;br /&gt;
&lt;br /&gt;
[[Libraries|Libraries]]&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6849</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6849"/>
		<updated>2014-01-25T09:08:12Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
The command to start RexxMast should already be in the S:Startup-Sequence file. If the command has been removed from S:Startup-Sequence, we suggest that you add it to the S:User-Startup file.&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The Rx command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked. The &amp;quot;Rx&amp;quot; may be in any case, for example, &amp;quot;RX&amp;quot;, &amp;quot;rx&amp;quot; and &amp;quot;Rx&amp;quot; will all work the same.&lt;br /&gt;
&lt;br /&gt;
As long as your program is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* matched with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names! This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot;Rx calc&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot;i&amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot;i&amp;quot; by 2 equals 0, then set the variable &amp;quot;type&amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot;type&amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square(i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot;square&amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot;square&amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot;i&amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot;square&amp;quot;, retrieves the argument &amp;quot;i&amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot;PULLed&amp;quot; and if it does not equal &amp;quot;Q&amp;quot; (quit), the loop continues. If the response equals &amp;quot;Q&amp;quot; , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q&amp;quot; /*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6848</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6848"/>
		<updated>2014-01-25T09:07:06Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
The command to start RexxMast should already be in the S:Startup-Sequence file. If the command has been removed from S:Startup-Sequence, we suggest that you add it to the S:User-Startup file.&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The Rx command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked. The &amp;quot;Rx&amp;quot; may be in any case, for example, &amp;quot;RX&amp;quot;, &amp;quot;rx&amp;quot; and &amp;quot;Rx&amp;quot; will all work the same.&lt;br /&gt;
&lt;br /&gt;
As long as your program is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* matched with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names! This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot;Rx calc&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot;i&amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot;i&amp;quot; by 2 equals 0, then set the variable &amp;quot;type&amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot;type&amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square(i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot;square&amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot;square&amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot;i&amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot;square&amp;quot;, retrieves the argument &amp;quot;i&amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot;PULLed&amp;quot; and if it does not equal &amp;quot;Q&amp;quot; (quit), the loop continues. If the response equals &amp;quot;Q&amp;quot; , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q &amp;quot;/*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6847</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6847"/>
		<updated>2014-01-25T09:06:02Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
The command to start RexxMast should already be in the S:Startup-Sequence file. If the command has been removed from S:Startup-Sequence, we suggest that you add it to the S:User-Startup file.&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The Rx command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked. The &amp;quot;Rx&amp;quot; may be in any case, for example, &amp;quot;RX&amp;quot;, &amp;quot;rx&amp;quot; and &amp;quot;Rx&amp;quot; will all work the same.&lt;br /&gt;
&lt;br /&gt;
As long as your program is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* matched with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names! This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot;Rx calc&amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot;i&amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot;i&amp;quot; by 2 equals 0, then set the variable &amp;quot;type&amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot;type&amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square(i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot;square&amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot;square&amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot;i&amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot;square&amp;quot;, retrieves the argument &amp;quot;i&amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot;PULLed&amp;quot; and if it does not equal Q (quit), the loop continues. If the response equals &amp;quot;Q&amp;quot; , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q &amp;quot;/*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Introducing_ARexx&amp;diff=6846</id>
		<title>AmigaOS Manual: ARexx Introducing ARexx</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Introducing_ARexx&amp;diff=6846"/>
		<updated>2014-01-25T08:43:41Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ARexx programming language can act as a central hub through which applications - even those created by different companies - can exchange data and commands. For example, using ARexx you can instruct a telecommunications package to dial an electronic bulletin board, download financial data from the bulletin board, and then automatically pass the data to a spreadsheet program for statistical analysis - without any user intervention.&lt;br /&gt;
&lt;br /&gt;
ARexx is an interpreted language that uses ASCII file input. The ARexx interpreter is the RexxMast program, located in the System drawer of Workbench. RexxMast monitors the execution of an ARexx program. If RexxMast finds an error while translating or executing a line, it halts and displays an error message on the screen. This interactive testing is both a learning tool and an aid in debugging programs because it immediately highlights when and where an error has occurred.&lt;br /&gt;
&lt;br /&gt;
= Who is ARexx For? =&lt;br /&gt;
&lt;br /&gt;
You do not need extensive Amiga experience to use ARexx programs and scripts, but you do need to know how:&lt;br /&gt;
&lt;br /&gt;
* To open a Shell and enter AmigaDOS commands&lt;br /&gt;
* To use a text editor, such as Notepad&lt;br /&gt;
* To edit the User-startup file&lt;br /&gt;
&lt;br /&gt;
However, to change the scripts or create your own ARexx scripts, you should have a basic understanding of both the Amiga Workbench and AmigaDOS environments. Experienced Amiga users may find ARexx easier and more powerful than AmigaDOS. In fact, ARexx can be used to enhance or replace existing AmigaDOS commands and scripts, as well as to create integrated applications.&lt;br /&gt;
&lt;br /&gt;
= ARexx on the Amiga =&lt;br /&gt;
&lt;br /&gt;
ARexx is supported on all Amiga hardware configurations. Beginning with the release of Amiga Workbench Version 2.0, ARexx has been integrated into the Amiga operating system. Specifically, ARexx uses two important features of the Amiga operating system: multitasking and interprocess communication.&lt;br /&gt;
&lt;br /&gt;
Multitasking is the ability to run more than one program at a time. For example, you can simultaneously edit a file, format a disk, and adjust your screen&#039;s colors.&lt;br /&gt;
&lt;br /&gt;
Interprocess communication (IPC) is the ability to allow the exchange of information between applications. Interprocess communication is accomplished through the use of message ports, an address contained in an application that can receive and send messages, attached to each program. Each message port has a name and sending a message to an application requires the use of the port&#039;s name in an ARexx script.&lt;br /&gt;
&lt;br /&gt;
The sequence of events in sending and receiving a message is:&lt;br /&gt;
&lt;br /&gt;
# On initialization an application opens its message port.&lt;br /&gt;
# The application waits to receive a message.&lt;br /&gt;
# The Amiga operating system notifies the application that a message has arrived at its port.&lt;br /&gt;
# The application acts on that message.&lt;br /&gt;
# The application notifies the message&#039;s sender (ARexx) that the message has been received and processed.&lt;br /&gt;
&lt;br /&gt;
This transfer of messages is not limited to one application and ARexx. Several applications can send messages back and forth using ARexx as the central transfer location. However, all the applications must be ARexx-compatible.&lt;br /&gt;
&lt;br /&gt;
= ARexx Features =&lt;br /&gt;
&lt;br /&gt;
Features of the ARexx programming language are:&lt;br /&gt;
&lt;br /&gt;
* Typeless Data - Data is treated as individual character strings and variable values are undeclared.&lt;br /&gt;
* Interpreted Execution - The read-and-execute ability of ARexx skips the extra step of program compilation.&lt;br /&gt;
* Automatic Resource Management - Automatic internal memory allocation removes unnecessary strings and data.&lt;br /&gt;
* Tracing, Trapping, and Debugging - Tracing and trapping permit handling of errors that would normally abort the program. The debugging facilities allow you to view your entire program, reducing development and testing time.&lt;br /&gt;
* Function Libraries - External function libraries provide extended, pre-programmed functions.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Introducing_ARexx&amp;diff=6845</id>
		<title>AmigaOS Manual: ARexx Introducing ARexx</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Introducing_ARexx&amp;diff=6845"/>
		<updated>2014-01-25T08:41:15Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ARexx programming language can act as a central hub through which applications - even those created by different companies - can exchange data and commands. For example, using ARexx you can instruct a telecommunications package to dial an electronic bulletin board, download financial data from the bulletin board, and then automatically pass the data to a spreadsheet program for statistical analysis - without any user intervention.&lt;br /&gt;
&lt;br /&gt;
ARexx is an interpreted language that uses ASCII file input. The ARexx interpreter is the RexxMast program, located in the System drawer of Workbench. RexxMast monitors the execution of an ARexx program. If RexxMast finds an error while translating or executing a line, it halts and displays an error message on the screen. This interactive testing is both a learning tool and an aid in debugging programs because it immediately highlights when and where an error has occurred.&lt;br /&gt;
&lt;br /&gt;
= Who is ARexx For? =&lt;br /&gt;
&lt;br /&gt;
You do not need extensive Amiga experience to use ARexx programs and scripts, but you do need to know how:&lt;br /&gt;
&lt;br /&gt;
* To open a Shell and enter AmigaDOS commands&lt;br /&gt;
* To use a text editor, such as Notepad&lt;br /&gt;
* To edit the User-startup file&lt;br /&gt;
&lt;br /&gt;
However, to change the scripts or create, your own ARexx scripts, you should have a basic understanding of both the Amiga Workbench and AmigaDOS environments. Experienced Amiga users may find ARexx easier and more powerful than AmigaDOS. In fact, ARexx can be used to enhance or replace existing AmigaDOS commands and scripts, as well as to create integrated applications.&lt;br /&gt;
&lt;br /&gt;
= ARexx on the Amiga =&lt;br /&gt;
&lt;br /&gt;
ARexx is supported on all Amiga hardware configurations. Beginning with the release of Amiga Workbench Version 2.0, ARexx has been integrated into the Amiga operating system. Specifically, ARexx uses two important features of the Amiga operating system: multitasking and interprocess communication.&lt;br /&gt;
&lt;br /&gt;
Multitasking is the ability to run more than one program at a time. For example, you can simultaneously edit a file, format a disk, and adjust your screen&#039;s colors.&lt;br /&gt;
&lt;br /&gt;
Interprocess communication (IPC) is the ability to allow the exchange of information between applications. Interprocess communication is accomplished through the use of message ports, an address contained in an application that can receive and send messages, attached to each program. Each message port has a name and sending a message to an application requires the use of the port&#039;s name in an ARexx script.&lt;br /&gt;
&lt;br /&gt;
The sequence of events in sending and receiving a message is:&lt;br /&gt;
&lt;br /&gt;
# On initialization an application opens its message port.&lt;br /&gt;
# The application waits to receive a message.&lt;br /&gt;
# The Amiga operating system notifies the application that a message has arrived at its port.&lt;br /&gt;
# The application acts on that message.&lt;br /&gt;
# The application notifies the message&#039;s sender (ARexx) that the message has been received and processed.&lt;br /&gt;
&lt;br /&gt;
This transfer of messages is not limited to one application and ARexx. Several applications can send messages back and forth using ARexx as the central transfer location. However, all the applications must be ARexx-compatible.&lt;br /&gt;
&lt;br /&gt;
= ARexx Features =&lt;br /&gt;
&lt;br /&gt;
Features of the ARexx programming language are:&lt;br /&gt;
&lt;br /&gt;
* Typeless Data - Data is treated as individual character strings and variable values are undeclared.&lt;br /&gt;
* Interpreted Execution - The read-and-execute ability of ARexx skips the extra step of program compilation.&lt;br /&gt;
* Automatic Resource Management - Automatic internal memory allocation removes unnecessary strings and data.&lt;br /&gt;
* Tracing, Trapping, and Debugging - Tracing and trapping permit handling of errors that would normally abort the program. The debugging facilities allow you to view your entire program, reducing development and testing time.&lt;br /&gt;
* Function Libraries - External function libraries provide extended, pre-programmed functions.&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6844</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6844"/>
		<updated>2014-01-25T08:37:31Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
The command to start RexxMast should already be in the S:Startup-Sequence file. If the command has been removed from S:Startup-Sequence, we suggest that you add it to the S:User-Startup file.&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The RX command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked.&lt;br /&gt;
&lt;br /&gt;
As long as your programs is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* balanced with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names. This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot; Rx calc &amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot; i &amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot; i &amp;quot; by 2 equals 0, then set the variable &amp;quot; type &amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot; type &amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square (i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot; square &amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot; square &amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot; i &amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot; square &amp;quot;, retrieves the argument &amp;quot; i &amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot; PULLed &amp;quot; and if it does not equal Q (quit), the loop continues. If the response equals Q , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q &amp;quot;/*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6843</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6843"/>
		<updated>2014-01-25T08:27:58Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The RX command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked.&lt;br /&gt;
&lt;br /&gt;
As long as your programs is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 Rx Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* balanced with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names. This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot; Rx calc &amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot; i &amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot; i &amp;quot; by 2 equals 0, then set the variable &amp;quot; type &amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot; type &amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square (i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot; square &amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot; square &amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot; i &amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot; square &amp;quot;, retrieves the argument &amp;quot; i &amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot; PULLed &amp;quot; and if it does not equal Q (quit), the loop continues. If the response equals Q , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q &amp;quot;/*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6842</id>
		<title>AmigaOS Manual: ARexx Getting Started</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=AmigaOS_Manual:_ARexx_Getting_Started&amp;diff=6842"/>
		<updated>2014-01-25T08:24:27Z</updated>

		<summary type="html">&lt;p&gt;Tony Wyatt: Fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This chapter shows you how to:&lt;br /&gt;
&lt;br /&gt;
* Start ARexx&lt;br /&gt;
* Save Programs&lt;br /&gt;
* Store Programs&lt;br /&gt;
* Use sample programs&lt;br /&gt;
&lt;br /&gt;
= Starting ARexx =&lt;br /&gt;
&lt;br /&gt;
To start using ARexx, you activate the RexxMast program. The RexxMast program can be started automatically or manually. Each time ARexx is started or stopped, a text message appears.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Automatically ==&lt;br /&gt;
&lt;br /&gt;
There are two methods to start ARexx automatically: add RexxMast to the WBStartup Prefs window or edit the S:User-Startup file.&lt;br /&gt;
&lt;br /&gt;
To place RexxMast in the WBStartup Prefs list:&lt;br /&gt;
&lt;br /&gt;
# Open the Prefs drawer.&lt;br /&gt;
# Open the WBStartup prefs.&lt;br /&gt;
# Click the &amp;quot;Add&amp;quot; button.&lt;br /&gt;
# Select SYS:System/RexxMast in the requester that pops up&lt;br /&gt;
# Click on &amp;quot;Save&amp;quot;&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
To edit the S:User-Startup file:&lt;br /&gt;
&lt;br /&gt;
# Open a text editor like Notepad.&lt;br /&gt;
# Open the S:User-Startup file.&lt;br /&gt;
# Enter &#039;&#039;SYS:System/RexxMast &amp;gt;NIL:&#039;&#039;&lt;br /&gt;
# Save the file.&lt;br /&gt;
# Reboot your Amiga.&lt;br /&gt;
&lt;br /&gt;
== To Start ARexx Manually ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to start RexxMast manually: double-click on the RexxMast icon in Workbench or start it from the Shell.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from Workbench:&lt;br /&gt;
&lt;br /&gt;
# Open the System Drawer.&lt;br /&gt;
# Double-click on the RexxMast icon.&lt;br /&gt;
&lt;br /&gt;
To start RexxMast from the Shell:&lt;br /&gt;
&lt;br /&gt;
# Open a Shell.&lt;br /&gt;
# Type &#039;&#039;RexxMast &amp;gt;NIL:&#039;&#039; and press Enter.&lt;br /&gt;
&lt;br /&gt;
= About ARexx Programs =&lt;br /&gt;
&lt;br /&gt;
ARexx programs are usually stored in the REXX: directory (which is generally assigned to the SYS:S/ARexx directory). Although programs can be stored in any directory, storing them in REXX: has several advantages:&lt;br /&gt;
&lt;br /&gt;
* You can run the program without having to type the complete path.&lt;br /&gt;
* All of your ARexx programs will be in the same place.&lt;br /&gt;
* Most applications search for ARexx programs in REXX:.&lt;br /&gt;
&lt;br /&gt;
Just as you can store an ARexx program anywhere, you can also name it anything you choose. However, adopting a simple naming convention will make program management much easier. Programs run from the Shell should have a .rexx extension to distinguish them from files run from other applications.&lt;br /&gt;
&lt;br /&gt;
== Running ARexx Programs ==&lt;br /&gt;
&lt;br /&gt;
The RX command is used to run an ARexx program. If a complete path is included with the program name, only that directory is searched for the program. If no path is included, the current directory and &#039;&#039;REXX:&#039;&#039; are checked.&lt;br /&gt;
&lt;br /&gt;
As long as your programs is stored in the &#039;&#039;REXX:&#039;&#039; directory, you do not need to include the .rexx extension when specifying your program name. In other words, typing:&lt;br /&gt;
&lt;br /&gt;
 RX Program.rexx&lt;br /&gt;
&lt;br /&gt;
is the same as:&lt;br /&gt;
&lt;br /&gt;
 Rx Program&lt;br /&gt;
&lt;br /&gt;
A short program can be entered directly at the command line by enclosing the program line in double-quotes. For example, the following program will send five files named myfile.1 through myfile.5 to the printer.&lt;br /&gt;
&lt;br /&gt;
 Rx &amp;quot;DO i=1 to 5;&lt;br /&gt;
 ADDRESS command `copy myfile.&#039; | | i `prt:&#039;; END&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When an application is ARexx-compatible, you can run ARexx programs from within the application by choosing a menu item or by specifying command options. Refer to the application&#039;s documentation for more information.&lt;br /&gt;
&lt;br /&gt;
ARexx programs can be run from the Workbench by creating a tool or project icon for the program. You must specify the Rx command as the Default Tool for the icon. In the icon&#039;s Information window, enter:&lt;br /&gt;
&lt;br /&gt;
 Default Tool: SYS:C/Rx&lt;br /&gt;
&lt;br /&gt;
When the icon is opened, Rx starts RexxMast (if it is not already running). It executes the file associated with the icon as an ARexx program.&lt;br /&gt;
&lt;br /&gt;
ARexx accepts two Tool Types: Console, to specify a window, and CMD, to specify a command string. You enter these Tool Types in the project icon&#039;s Information window as:&lt;br /&gt;
&lt;br /&gt;
 Console=CON:0/0/640/200/Example/Close&lt;br /&gt;
 CMD=rexxprogram&lt;br /&gt;
&lt;br /&gt;
= Program Examples =&lt;br /&gt;
&lt;br /&gt;
The following examples illustrate how to use ARexx to display text strings on your screen, to perform calculations, and to activate the error checking feature.&lt;br /&gt;
&lt;br /&gt;
Programs can be entered into any text editor, such as Notepad or a word processor. Save your program as an ASCII file if you use a word processor. ARexx supports the extended ASCII character set (Å, Æ, ß). These extended characters are recognized as ordinary printing characters and will be mapped from lowercase to uppercase.&lt;br /&gt;
&lt;br /&gt;
The examples also illustrate the use of some basic ARexx syntax requirements such as:&lt;br /&gt;
&lt;br /&gt;
* Comment lines&lt;br /&gt;
* Spacing rules&lt;br /&gt;
* Case-sensitivity&lt;br /&gt;
* Use of single and double quotes&lt;br /&gt;
&lt;br /&gt;
Each ARexx program consists of a comment line that describes the program and an instruction that displays text on the console. ARexx programs must always begin with a comment line. The initial (slash asterisk) /* balanced with an ending (asterisk slash) */ tells the RexxMast interpreter that it has found an ARexx program. Without the /* and the */, RexxMast will not view the file as an ARexx program. Once it begins executing the program, ARexx ignores any additional comment lines within the file. However, comment lines are extremely useful when reading the program. They can help organize and make sense of a program.&lt;br /&gt;
&lt;br /&gt;
== Amiga.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program shows how to use SAY in a set of instructions to display text strings on the screen. Instructions are language statements that denote a certain action to be performed. Each statement always begins with a symbol. In the following example, the symbol is SAY. (Symbols are always translated to uppercase letters when the program is run.) Following SAY is an example of a string. A string is a series of characters surrounded by single quotes (`) or double quotes (&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Program 1. Amiga.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*A simple program*/&lt;br /&gt;
SAY `Amiga. The Computer For the Creative Mind.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the above program, and save it as REXX:Amiga.rexx . To run the program, open a Shell window and type:&lt;br /&gt;
&lt;br /&gt;
 Rx Amiga&lt;br /&gt;
&lt;br /&gt;
Although the full path and program name is &#039;&#039;Rexx:Amiga.rexx&#039;&#039;, you do not need to type the REXX: directory name or the .rexx extension if the program has been saved in the REXX: directory.&lt;br /&gt;
&lt;br /&gt;
You should see the following text in your Shell window:&lt;br /&gt;
&lt;br /&gt;
 Amiga. The Computer for the Creative Mind.&lt;br /&gt;
&lt;br /&gt;
== Age.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program displays a prompt for input and then reads entered information.&lt;br /&gt;
&lt;br /&gt;
=== Program 2. Age.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate age in days*/&lt;br /&gt;
SAY `Please enter your age:&#039;&lt;br /&gt;
PULL age&lt;br /&gt;
SAY `You are about&#039; age*365 `days old.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save this program as &#039;&#039;REXX:Age.rexx&#039;&#039; and run it with the command:&lt;br /&gt;
&lt;br /&gt;
 Rx age&lt;br /&gt;
&lt;br /&gt;
This program begins with a comment line that describes what the program will do. All ARexx programs begin with a comment. The SAY instruction displays a request for input on the console.&lt;br /&gt;
&lt;br /&gt;
The PULL instruction reads a line of input from the user, which in this case is the user&#039;s age. PULL takes the input, converts it to uppercase letters, and stores it in a variable. Variables are symbols which may be assigned a value. Choose descriptive variable names. This example uses the variable name &amp;quot;age&amp;quot; to hold the entered number.&lt;br /&gt;
&lt;br /&gt;
The final line multiplies the variable &amp;quot;age&amp;quot; by 365 and issues the SAY instruction to display the result. The &amp;quot;age&amp;quot; variable did not have to be declared as a number because its value was checked when it was used in the expression. This is an example of typeless data. To see what would happen if age was not a number, try running the program again with a non-numeric entry for the age. The resulting error message shows the line number and type of error that occurred.&lt;br /&gt;
&lt;br /&gt;
== Calc.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program introduces the DO instruction, which repeats the execution of program statements. It also illustrates the exponentiation operator ( ** ). Enter this program and save it as &#039;&#039;REXX:Calc.rexx&#039;&#039;. To run the program, use the &amp;quot; Rx calc &amp;quot; command.&lt;br /&gt;
&lt;br /&gt;
=== Program 3. Calc.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Calculate some squares and cubes.*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
SAY i i**2 i**3 /*Perform calculations*/&lt;br /&gt;
END /*End of loop*/&lt;br /&gt;
SAY `All done.&#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The DO instruction repeatedly executes the statements between the DO and END instructions. The variable &amp;quot; i &amp;quot; is the index variable for the loop and is incremented by 1 for each iteration (repetition). The number following the symbol TO is the limit for the DO instruction and could have been a variable or a full expression rather than just the constant 10.&lt;br /&gt;
&lt;br /&gt;
Generally, ARexx programs use single spacing between alphanumeric characters. In Program 3, however, spacing is closed up between the exponentiation characters ( ** ) and the variables ( i and 2, i and 3).&lt;br /&gt;
&lt;br /&gt;
The statements within the loop have been indented. This is not required by the language, but it makes the program more readable, because you can easily visualize where the loop starts and stops.&lt;br /&gt;
&lt;br /&gt;
== Even.rexx ==&lt;br /&gt;
&lt;br /&gt;
The IF instruction allows statements to be conditionally executed. In this example, the numbers from 1 to 10 are classified as odd or even by dividing them by 2 and then checking the remainder. The // arithmetic operator calculates the remainder after a division operation.&lt;br /&gt;
&lt;br /&gt;
=== Program 4. Even.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Even or odd?*/&lt;br /&gt;
DO i = 1 to 10 /*Begin loop - 10 iterations*/&lt;br /&gt;
IF 1 // 2 = 0 THEN type = `even&#039;&lt;br /&gt;
ELSE type = `odd&#039;&lt;br /&gt;
SAY i `is&#039; type&lt;br /&gt;
END /*End loop*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IF line states that if the remainder of the division of the variable &amp;quot; i &amp;quot; by 2 equals 0, then set the variable &amp;quot; type &amp;quot; to even. If the remainder is not 0, the program will skip over the THEN branch and execute the ELSE branch, setting variable &amp;quot; type &amp;quot; to odd.&lt;br /&gt;
&lt;br /&gt;
== Square.rexx ==&lt;br /&gt;
&lt;br /&gt;
This example introduces the concept of a function, a group of statements executed by mentioning the function name in a suitable context. Functions allow you to build large complex programs from smaller modules. Functions also permit the same code for similar operations in a different program.&lt;br /&gt;
&lt;br /&gt;
Functions are specified in an expression as a name followed by an open parenthesis. (There is no space between the name and the parenthesis.) One or more expressions, called arguments, may follow the parenthesis. The last argument must be followed by a closing parenthesis. These arguments pass information to the function for processing.&lt;br /&gt;
&lt;br /&gt;
=== Program 5. Square.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Defining and calling a function.*/&lt;br /&gt;
&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
SAY i square (i) /*Call the &amp;quot;square&amp;quot; function*/&lt;br /&gt;
END&lt;br /&gt;
EXIT&lt;br /&gt;
square: /*Function name*/&lt;br /&gt;
ARG x /*Get the argument*/&lt;br /&gt;
RETURN x**2 /*Square it and return*/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Starting with DO and ending with END , a loop is set up with an index variable &amp;quot;i&amp;quot;, that will increment by 1. The loop will iterate (repeat) five times. The loop contains an expression that calls the function &amp;quot; square &amp;quot; when the expression is evaluated. The function&#039;s result is displayed using the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
The function &amp;quot; square &amp;quot;, defined by the ARG and RETURN instructions, calculates the squared values. ARG retrieves the value of the argument string &amp;quot; i &amp;quot; and RETURN passes the function&#039;s result back to the SAY instruction.&lt;br /&gt;
&lt;br /&gt;
Once the function is called by the loop, the program looks for the function name &amp;quot; square &amp;quot;, retrieves the argument &amp;quot; i &amp;quot;, performs a calculation, and returns to the line within the DO/END loop. The EXIT instruction ends the program after the final loop.&lt;br /&gt;
&lt;br /&gt;
== Results.rexx ==&lt;br /&gt;
&lt;br /&gt;
The TRACE instruction activates ARexx&#039;s error checking feature.&lt;br /&gt;
&lt;br /&gt;
=== Program 6. Results.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Demonstrate &amp;quot;results&amp;quot; tracing*/&lt;br /&gt;
TRACE results&lt;br /&gt;
sum = 0 ; sumsq = 0;&lt;br /&gt;
DO i = 1 to 5&lt;br /&gt;
sum = sum + 1&lt;br /&gt;
sumsq = sumsq + i**2&lt;br /&gt;
END&lt;br /&gt;
SAY `sum=&#039; sum `sumsq=&#039; sumsq&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The console displays the executed source lines, each pass through the DO/END loop, and the expression&#039;s final results. Removing the TRACE instruction, would display only the final result: sum = 15 sumsq = 55 .&lt;br /&gt;
&lt;br /&gt;
== Grades.rexx ==&lt;br /&gt;
&lt;br /&gt;
This program calculates the final grade for a given student based on four essay grades and a class participation grade. The average of Essay 1 and Essay 2 is worth 30%, the average of Essay 3 and Essay 4 is worth 45%, and participation is worth 25% of the final grade.&lt;br /&gt;
&lt;br /&gt;
Once a final grade is displayed, an option to continue with another calculation is presented. The response is &amp;quot; PULLed &amp;quot; and if it does not equal Q (quit), the loop continues. If the response equals Q , the program quits the loop and exits.&lt;br /&gt;
&lt;br /&gt;
=== Program 7. Grades.rexx ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/*Grading program*/&lt;br /&gt;
SAY &amp;quot;Hallo, I will calculate your grades for you.&amp;quot;&lt;br /&gt;
Response = 0&lt;br /&gt;
DO while response ~ = &amp;quot;Q &amp;quot;/*Loop while response isn&#039;t Q*/&lt;br /&gt;
SAY &amp;quot;Please enter all grades for the student.&amp;quot;&lt;br /&gt;
SAY &amp;quot;Essay 1:&amp;quot;&lt;br /&gt;
PULL es1&lt;br /&gt;
SAY &amp;quot;Essay 2:&amp;quot;&lt;br /&gt;
PULL es2&lt;br /&gt;
SAY &amp;quot;Essay 3:&amp;quot;&lt;br /&gt;
PULL es3&lt;br /&gt;
SAY &amp;quot;Essay 4:&amp;quot;&lt;br /&gt;
PULL es4&lt;br /&gt;
SAY &amp;quot;Participation:&amp;quot;&lt;br /&gt;
PULL p&lt;br /&gt;
Final = (((es1 + es2)/2*.3) + ((es3 + es4)/2*.45) + (p*.25))&lt;br /&gt;
SAY &amp;quot;Your final grade for this student is &amp;quot; Final&lt;br /&gt;
SAY &amp;quot;Would you like to continue? (Q for quit.)&amp;quot;&lt;br /&gt;
PULL response&lt;br /&gt;
END&lt;br /&gt;
EXIT &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tony Wyatt</name></author>
	</entry>
</feed>