home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 44
/
Amiga_Dream_44.iso
/
Amiga
/
programmation
/
Regina.lha
/
rexx.man
< prev
Wrap
Text File
|
1997-08-27
|
13KB
|
396 lines
rexx (1) Commands and Applications rexx (1)
Name
rexx - The Regina Rexx interpreter
Syntax
rexx [ options ] [ script [ scriptparams ]]
Description
Rexx will read the file named as script and will assume the
contents of that file to be a Rexx script and interpret that
script. Any parameters following script will be interpreted as
the parameters to the Rexx script. If script is not specified,
the Rexx script to interpret will be read from standard input,
and interpretation will start when the whole script has been
read.
If `-' is specified as script then the script will be read from
standard input.
Options
-tx
Starts interpretation with traceing set to "x". If you
want to run your program with tracing set to "all", you
can use the option -ta. If only -t is specified,
"all" is the trace mode set.
-i
Starts Regina in interactive mode. No script will be
executed.
Built-ins
Below is a list of all the standard built-in functions in Rexx.
For a more complete description of each function, see the
documentation accompanying Regina.
ABBREV(long,short[,length])
Returns `1' or 0', depending on whether `short' is an
abbrevation of `long', or at least `length' characters.
ABS(number)
Returns the absolute value of `number'.
ADDRESS()
Returns the name of the current environment.
ARG([argno[,option]])
Without parameters, it returns the number of
parameters. If only `argno' is specified, it must be a
number, and that parameter is returned. `Option' can be
either `E' or `O', and then either `0' or `1' is
returned, depending on whether the numbered parameter
existed or was ommitted.
B2X(binstring)
Wed Aug 27 08:16:38 1997 Page 1
rexx (1) Commands and Applications rexx (1)
Converts the bin-string `binstring' to a hex-string.
BITAND(string1[,[string2][,padchar]])
Returns a string which is the bitwise AND of its two
first parameters. The shorter string is padded with
`padchar'.
BITOR(string1[,[string2][,padchar]])
Like `BITAND' but uses logical OR.
BITXOR(string1[,[string2][,padchar]])
Like `BITAND' but uses logical XOR.
C2D(string[,length])
Converts the character string `string' to a decimal
number. `Length' specifies the number of characters in
`string' to convert.
C2X(string)
Converts the character string `string' to a hex-string.
CENTER(string,length[,padchar])
CENTRE(string,length[,padchar])
Centers `string' in a string of `length' characters,
using `padchar' for padding, if neccessary.
CHARIN([streamid][,[start][,length]])
Read `length' (default is 1) characters from an input
stream (default is the standard input stream),
optionally starting at position `start' (default is the
current read position).
CHAROUT([streamid][,[string][,start]])
Writes `stream' to an output stream (default is the
standard output stream), starting at position `start'
(default is the current write position).
CHARS([streamid])
Returns the number of characters left in the input
stream (default is the standard input stream).
COMPARE(string1,string2[,padchar])
Returns `0' or `1', depending on whether the two strings
are equal. The shorter string is padded with `padchar',
or space if padchar is ommitted.
CONDITION([option])
Performs various operations on streams, see other
documentation.
COPIES(string,copies)
Returns `copies' copies of the string `string'.
Wed Aug 27 08:16:38 1997 Page 2
rexx (1) Commands and Applications rexx (1)
DATATYPE(string[,option])
Returns the datatype of `string': `NUM' if it is a
number, `LIT' if it is as valid literal that does not
have a variable value, `VAR' if it is a variable, and
`BAD' otherwise. If `option' is specified, it must be
one of these four, and then `0' or `1' is returned,
depending on whether `string' is of the named type.
DATE([option])
Returns the date, in various formats, which can be Base,
Century, Days, European, Month, Normal, Ordered,
Standard, USA, or Weekday.
DELSTR(string,start[,length])
Deletes the substring of `string' starting at position
`start' and having a length of `length' (default is the
rest of the string).
DELWORD(string,start[,length])
Deletes `length' words (default is the rest of the
string) from `string', starting at word number `start'
DIGITS()
Returns the current setting of NUMERIC DIGITS.
D2C(integer[,length])
Converts the decimal number `integer' to a character
string of length `length'.
D2X(integer[,length])
Converts the decimal number `integer' to a hex-string of
length `length'.
ERRORTEXT(errno)
Returns the error text associated with error number
`errno'.
FORM()
Returns the current setting of NUMERIC FORM.
FORMAT(number[,[before][,[after][,[expp][,[expt]]]]])
Formats `number' into a string having `before' digits
before and `after' digits after the decimal point. The
`expp' and `expt' governs how and when to use
exponential form.
FUZZ()
Returns the current setting of NUMERIC FUZZ.
INSERT(string1,string2[,position[,length[,padchar]]])
Inserts `string1' into `string2' at position `position'
and with a length of `length'.
LASTPOS(needle,haystack[,start])
Wed Aug 27 08:16:38 1997 Page 3
rexx (1) Commands and Applications rexx (1)
Seeks for `needle' in `haystack', from the end towards
the start.
LEFT(string,length[,padchar])
Returns the `length' leftmost characters in `string'
LENGTH(string)
Returns the number of characters in `string'.
LINEIN([streamid][,[line][,count]])
Reads a line from an input stream (default is the
standard input stream), optionally starting at `line'.
If `count' is zero, no reading is performed (only
repositioning).
LINEOUT([streamid][,[string][,line]])
Writes the line `string' to an output stream (default is
the standard output stream, optionally starting at
`line'.
LINES([streamid])
Returns the number of complete lines left in an input
stream.
MAX(number1[,number2]...)
Returns the maximum of its parameters.
MIN(number[,number]...)
Returns the minimum of its parameters.
OVERLAY(string1,string2[,[start][,[length][,padchar]]])
Overwrites `string2' with contents of `string1'.
POS(needle,haystack[,start])
Seeks for first occurrence of `needle' in `haystack'.
QUEUED()
Returns the number of lines in the external data queue
(stack).
RANDOM(max)
RANDOM([min][,[max][,seed]])
Returns a random number in the range `min' to `max'
(default is 0 and 100000).
REVERSE(string)
Reverses the order of the characters in `string'.
RIGHT(string,length[,padchar])
Returns the `length' rightmost characters in `string'.
SIGN(number)
Returns `-1', `0', or `1', depending on the sign of
Wed Aug 27 08:16:38 1997 Page 4
rexx (1) Commands and Applications rexx (1)
`number'.
SOURCELINE([lineno])
Returns the number of lines in the source for the
current script, or the line specified by `lineno'.
SPACE(string[,[length][,padchar]])
Transform any sequence of spaces in `string' into
exactly `length' spaces, and strips off leading and
trailing spaces.
STEAM(streamid[,option[,command]])
Returns infomation about a stream, valid options are
`Command', `Description', and `State'. See other
documentation for more information.
STRIP(string[,[option][,char]])
Strips leading and trailing `char's off `string'.
`Option' can be Leading, Trailing, or Both.
SUBSTR(string,start[,[length][,padchar]])
Returns the substring of `string' starting at `start'
and having length `length'.
SUBWORD(string,start[,length])
Returns a subsequence of `length' words from `string'
starting at `start'.
SYMBOL(name)
Test whether `name' is a numbol, variable, literal.
TIME([option])
Returns the time, options are Civil, Elapsed, Hours,
Long, Minutes, Normal, Reset, and Seconds.
TRACE([setting])
Returns the current trace setting, and optionally sets a
new one.
TRANSLATE(string[,[tablein][,[tableout][,padchar]]])
Translates characters in `string' from `tablein' to
`tableout'.
TRUNC(number[,length])
Truncates `number' to `length' decimals.
VALUE(symbol[,[value],[pool]])
Returns the value of `symbol', optionally setting it to
`value' afterwards.
VERIFY(string,ref[,[option][,start]])
Verifies that `strings' consists of characters from
`ref', and returns the first character that does not
match. `Option' can be Match or Nomatch.
Wed Aug 27 08:16:38 1997 Page 5
rexx (1) Commands and Applications rexx (1)
WORD(string,wordno)
Returns word number `wordno' in `string'.
WORDINDEX(string,wordno)
Returns the character position of word nun
WORDLENGTH(string,wordno)
Returns the length of word number `wordno' in `string'.
WORDPOS(phrase,string[,start])
Returns the word position of the start of `phrase' in
`string'.
WORDS(string)
Returns the number of words in `string'.
XRANGE([start][,end])
Returns in alphabetic order all the characters in the
character set from the character `start' to the
character `end'.
X2B(hexstring)
Converts the hex-string `hexstring' to a bin-string.
X2C(hexstring)
Converts the hex-string `hexstring' to a character
string.
X2D(hexstring[,length])
Converts the `length' rightmost characters of the
hex-string `hexstring' to a decimal number.
Copyright
The Regina Rexx interpreter is distributed under the GNU Public
Lisence, see the file `COPYING' in the source code
distribution.
Author
<anders@lise.unit.no>.
See Also
There are several good reference books on Rexx. The most famous
is "The Rexx Language" by Mike Cowlishaw. Documentation for
Regina is located in the directory `doc' in the source code
distribution.
Wed Aug 27 08:16:38 1997 Page 6