<s>
Rexx	B-Language
(	O
Restructured	B-Language
Extended	I-Language
Executor	I-Language
)	O
is	O
a	O
programming	O
language	O
that	O
can	O
be	O
interpreted	B-Application
or	O
compiled	B-Language
.	O
</s>
<s>
It	O
is	O
a	O
structured	B-Language
,	O
high-level	B-Language
programming	I-Language
language	I-Language
designed	O
for	O
ease	O
of	O
learning	O
and	O
reading	O
.	O
</s>
<s>
Proprietary	O
and	O
open	B-Application
source	I-Application
Rexx	B-Language
interpreters	B-Application
exist	O
for	O
a	O
wide	O
range	O
of	O
computing	O
platforms	O
;	O
compilers	B-Language
exist	O
for	O
IBM	O
mainframe	B-Architecture
computers	I-Architecture
.	O
</s>
<s>
Rexx	B-Language
is	O
a	O
full	O
language	O
that	O
can	O
be	O
used	O
as	O
a	O
scripting	B-Language
,	O
macro	O
language	O
,	O
and	O
application	O
development	O
language	O
.	O
</s>
<s>
It	O
is	O
often	O
used	O
for	O
processing	O
data	O
and	O
text	O
and	O
generating	O
reports	O
;	O
these	O
similarities	O
with	O
Perl	B-Language
mean	O
that	O
Rexx	B-Language
works	O
well	O
in	O
Common	B-Language
Gateway	I-Language
Interface	I-Language
(	O
CGI	O
)	O
programming	O
and	O
it	O
is	O
indeed	O
used	O
for	O
this	O
purpose	O
.	O
</s>
<s>
Rexx	B-Language
is	O
the	B-Language
primary	O
scripting	B-Language
language	I-Language
in	O
some	O
operating	O
systems	O
,	O
e.g.	O
</s>
<s>
OS/2	B-Application
,	O
MVS	B-Application
,	O
VM	B-Application
,	O
AmigaOS	B-Application
,	O
and	O
is	O
also	O
used	O
as	O
an	O
internal	O
macro	O
language	O
in	O
some	O
other	O
software	O
,	O
such	O
as	O
SPF/PC	B-Application
,	O
KEDIT	O
,	O
THE	B-Language
and	O
the	B-Language
ZOC	B-Protocol
terminal	O
emulator	O
.	O
</s>
<s>
Additionally	O
,	O
the	B-Language
Rexx	B-Language
language	O
can	O
be	O
used	O
for	O
scripting	B-Language
and	O
macros	O
in	O
any	O
program	O
that	O
uses	O
Windows	B-Application
Scripting	B-Language
Host	O
ActiveX	O
scripting	B-Language
engines	I-Language
languages	O
(	O
e.g.	O
</s>
<s>
VBScript	O
and	O
JScript	B-Language
)	O
if	O
one	O
of	O
the	B-Language
Rexx	B-Language
engines	O
is	O
installed	O
.	O
</s>
<s>
Rexx	B-Language
is	O
supplied	O
with	O
VM/SP	B-Application
Release	O
3	O
on	O
up	O
,	O
TSO/E	O
Version	O
2	O
on	O
up	O
,	O
OS/2	B-Application
(	O
1.3	O
and	O
later	O
,	O
where	O
it	O
is	O
officially	O
named	O
Procedures	O
Language/2	O
)	O
,	O
AmigaOS	B-Application
Version	O
2	O
on	O
up	O
,	O
PC	B-Operating_System
DOS	I-Operating_System
(	O
7.0	O
or	O
2000	O
)	O
,	O
ArcaOS	B-Device
,	O
and	O
Windows	B-Application
NT	O
4.0	O
(	O
Resource	O
Kit	O
:	O
Regina	O
)	O
.	O
</s>
<s>
REXX	B-Language
scripts	O
for	O
CMS	O
share	O
the	B-Language
filetype	O
EXEC	B-Operating_System
with	O
EXEC	B-Operating_System
and	O
EXEC2	B-Application
,	O
and	O
the	B-Language
first	O
line	O
of	O
the	B-Language
script	O
specifies	O
the	B-Language
interpreter	B-Application
to	O
be	O
used	O
.	O
</s>
<s>
REXX	B-Language
scripts	O
for	O
MVS	B-Application
may	O
be	O
recognized	O
by	O
the	B-Language
low	O
level	O
qualifier	O
EXEC	B-Operating_System
or	O
may	O
be	O
recognized	O
by	O
context	O
and	O
the	B-Language
first	O
line	O
.	O
</s>
<s>
REXX	B-Language
scripts	O
for	O
OS/2	B-Application
share	O
the	B-Language
filename	O
extension	O
.cmd	O
with	O
other	O
scripting	B-Language
languages	I-Language
,	O
and	O
the	B-Language
first	O
line	O
of	O
the	B-Language
script	O
specifies	O
the	B-Language
interpreter	B-Application
to	O
be	O
used	O
.	O
</s>
<s>
REXX	B-Language
macros	O
for	O
REXX-aware	O
applications	O
use	O
extensions	O
determined	O
by	O
the	B-Language
application	O
.	O
</s>
<s>
In	O
the	B-Language
late	O
1980s	O
,	O
Rexx	B-Language
became	O
the	B-Language
common	O
scripting	B-Language
language	I-Language
for	O
IBM	B-Device
Systems	I-Device
Application	I-Device
Architecture	I-Device
,	O
where	O
it	O
was	O
renamed	O
"	O
SAA	O
Procedure	O
Language	O
REXX	B-Language
"	O
.	O
</s>
<s>
A	O
Rexx	B-Language
script	O
or	O
command	O
is	O
sometimes	O
referred	O
to	O
as	O
an	O
EXEC	B-Operating_System
in	O
a	O
nod	O
to	O
the	B-Language
CMS	O
file	O
type	O
used	O
for	O
EXEC	B-Operating_System
,	O
EXEC	B-Application
2	I-Application
and	O
REXX	B-Language
scripts	O
on	O
CP/CMS	B-Application
and	O
VM/370	B-Application
through	O
z/VM	B-Application
.	O
</s>
<s>
Rexx	B-Language
has	O
the	B-Language
following	O
characteristics	O
and	O
features	O
:	O
</s>
<s>
The	B-Language
ability	O
to	O
support	O
functions	O
,	O
procedures	O
and	O
commands	O
associated	O
with	O
a	O
specific	O
invoking	O
environment	B-Device
.	O
</s>
<s>
A	O
built-in	O
stack	O
,	O
with	O
the	B-Language
ability	O
to	O
interoperate	O
with	O
the	B-Language
host	O
stack	O
if	O
there	O
is	O
one	O
.	O
</s>
<s>
Rexx	B-Language
has	O
just	O
twenty-three	O
,	O
largely	O
self-evident	O
,	O
instructions	O
(	O
such	O
as	O
call	O
,	O
parse	O
,	O
and	O
select	O
)	O
with	O
minimal	O
punctuation	O
and	O
formatting	O
requirements	O
.	O
</s>
<s>
It	O
is	O
essentially	O
an	O
almost	O
free-form	B-Language
language	I-Language
with	O
only	O
one	O
data-type	O
,	O
the	B-Language
character	O
string	O
;	O
this	O
philosophy	O
means	O
that	O
all	O
data	O
are	O
visible	O
(	O
symbolic	O
)	O
and	O
debugging	O
and	O
tracing	O
are	O
simplified	O
.	O
</s>
<s>
Rexx	B-Language
's	O
syntax	O
looks	O
similar	O
to	O
PL/I	B-Language
,	O
but	O
has	O
fewer	O
notations	O
;	O
this	O
makes	O
it	O
harder	O
to	O
parse	O
(	O
by	O
program	O
)	O
but	O
easier	O
to	O
use	O
,	O
except	O
for	O
cases	O
where	O
PL/I	B-Language
habits	O
may	O
lead	O
to	O
surprises	O
.	O
</s>
<s>
One	O
of	O
the	B-Language
REXX	B-Language
design	O
goals	O
was	O
the	B-Language
principle	O
of	O
least	O
astonishment	O
.	O
</s>
<s>
Rexx	B-Language
was	O
designed	O
and	O
first	O
implemented	O
,	O
in	O
assembly	B-Language
language	I-Language
,	O
as	O
an	O
'	O
own-time	O
'	O
project	O
between	O
20	O
March	O
1979	O
and	O
mid-1982	O
by	O
Mike	O
Cowlishaw	O
of	O
IBM	O
,	O
originally	O
as	O
a	O
scripting	B-Language
programming	I-Language
language	I-Language
to	O
replace	O
the	B-Language
languages	O
EXEC	B-Operating_System
and	O
EXEC	B-Application
2	I-Application
.	O
</s>
<s>
It	O
was	O
designed	O
to	O
be	O
a	O
macro	O
or	O
scripting	B-Language
language	I-Language
for	O
any	O
system	O
.	O
</s>
<s>
As	O
such	O
,	O
Rexx	B-Language
is	O
considered	O
a	O
precursor	O
to	O
Tcl	B-Operating_System
and	O
Python	B-Language
.	O
</s>
<s>
Rexx	B-Language
was	O
also	O
intended	O
by	O
its	O
creator	O
to	O
be	O
a	O
simplified	O
and	O
easier	O
to	O
learn	O
version	O
of	O
the	B-Language
PL/I	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
However	O
,	O
some	O
differences	O
from	O
PL/I	B-Language
may	O
trip	O
up	O
the	B-Language
unwary	O
.	O
</s>
<s>
It	O
was	O
first	O
described	O
in	O
public	O
at	O
the	B-Language
SHARE	O
56	O
conference	O
in	O
Houston	O
,	O
Texas	O
,	O
in	O
1981	O
,	O
where	O
customer	O
reaction	O
,	O
championed	O
by	O
Ted	O
Johnston	O
of	O
SLAC	O
,	O
led	O
to	O
it	O
being	O
shipped	O
as	O
an	O
IBM	O
product	O
in	O
1982	O
.	O
</s>
<s>
Over	O
the	B-Language
years	O
IBM	O
included	O
Rexx	B-Language
in	O
almost	O
all	O
of	O
its	O
operating	O
systems	O
(	O
VM/CMS	B-Application
,	O
MVS	B-Application
TSO/E	I-Application
,	O
IBM	B-Application
i	I-Application
,	O
VSE/ESA	O
,	O
AIX	B-Application
,	O
PC	B-Operating_System
DOS	I-Operating_System
,	O
and	O
OS/2	B-Application
)	O
,	O
and	O
has	O
made	O
versions	O
available	O
for	O
Novell	B-Operating_System
NetWare	I-Operating_System
,	O
Windows	B-Application
,	O
Java	B-Language
,	O
and	O
Linux	B-Application
.	O
</s>
<s>
The	B-Language
first	O
non-IBM	O
version	O
was	O
written	O
for	O
PC	B-Operating_System
DOS	I-Operating_System
by	O
Charles	O
Daney	O
in	O
1984/5	O
and	O
marketed	O
by	O
the	B-Language
Mansfield	O
Software	O
Group	O
(	O
founded	O
by	O
Kevin	O
J	O
.	O
Kearney	O
in	O
1986	O
)	O
.	O
</s>
<s>
The	B-Language
first	O
compiler	B-Language
version	O
appeared	O
in	O
1987	O
,	O
written	O
for	O
CMS	O
by	O
Lundin	O
and	O
Woodruff	O
.	O
</s>
<s>
Other	O
versions	O
have	O
also	O
been	O
developed	O
for	O
Atari	O
,	O
AmigaOS	B-Application
,	O
Unix	B-Application
(	O
many	O
variants	O
)	O
,	O
Solaris	B-Application
,	O
DEC	O
,	O
Windows	B-Application
,	O
Windows	B-Operating_System
CE	I-Operating_System
,	O
Pocket	B-Device
PC	I-Device
,	O
DOS	B-Device
,	O
Palm	B-Operating_System
OS	I-Operating_System
,	O
QNX	B-Operating_System
,	O
OS/2	B-Application
,	O
Linux	B-Application
,	O
BeOS	B-Application
,	O
EPOC32/Symbian	O
,	O
AtheOS	B-Application
,	O
OpenVMS	B-Operating_System
,	O
Apple	O
Macintosh	B-Device
,	O
and	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
.	O
</s>
<s>
The	B-Language
Amiga	B-Device
version	O
of	O
Rexx	B-Language
,	O
called	O
ARexx	B-Operating_System
,	O
was	O
included	O
with	O
AmigaOS	B-Application
2	O
onwards	O
and	O
was	O
popular	O
for	O
scripting	B-Language
as	O
well	O
as	O
application	O
control	O
.	O
</s>
<s>
Many	O
Amiga	B-Device
applications	O
have	O
an	O
"	O
ARexx	B-Operating_System
port	O
"	O
built	O
into	O
them	O
which	O
allows	O
control	O
of	O
the	B-Language
application	O
from	O
Rexx	B-Language
.	O
</s>
<s>
One	O
single	O
Rexx	B-Language
script	O
could	O
even	O
switch	O
between	O
different	O
Rexx	B-Language
ports	O
in	O
order	O
to	O
control	O
several	O
running	O
applications	O
.	O
</s>
<s>
In	O
1990	O
,	O
Cathie	O
Dager	O
of	O
SLAC	O
organized	O
the	B-Language
first	O
independent	O
Rexx	B-Language
symposium	O
,	O
which	O
led	O
to	O
the	B-Language
forming	O
of	O
the	B-Language
REXX	B-Language
Language	O
Association	O
.	O
</s>
<s>
Several	O
freeware	B-License
versions	O
of	O
Rexx	B-Language
are	O
available	O
.	O
</s>
<s>
In	O
1992	O
,	O
the	B-Language
two	O
most	O
widely	O
used	O
open-source	B-Application
ports	O
appeared	O
:	O
Ian	O
Collier	O
's	O
REXX/imc	O
for	O
Unix	B-Application
and	O
Anders	O
Christensen	O
's	O
Regina	O
(	O
later	O
adopted	O
by	O
Mark	O
Hessling	O
)	O
for	O
Windows	B-Application
and	O
Unix	B-Application
.	O
</s>
<s>
is	O
well	O
known	O
for	O
WinCE	B-Operating_System
and	O
Pocket	B-Device
PC	I-Device
platforms	O
,	O
and	O
has	O
been	O
"	O
back-ported	O
"	O
to	O
VM/370	B-Application
and	O
MVS	B-Application
.	O
</s>
<s>
OS/2	B-Application
has	O
a	O
visual	O
development	O
system	O
from	O
Watcom	O
VX-REXX	B-Application
.	O
</s>
<s>
Another	O
dialect	O
was	O
VisPro	O
REXX	B-Language
from	O
Hockware	O
.	O
</s>
<s>
Portable	B-Language
Rexx	I-Language
by	O
Kilowatt	O
and	O
Personal	B-Language
Rexx	I-Language
by	O
Quercus	O
are	O
two	O
Rexx	B-Language
interpreters	B-Application
designed	O
for	O
DOS	B-Device
and	O
can	O
be	O
run	O
under	O
Windows	B-Application
as	O
well	O
using	O
a	O
command	O
prompt	O
.	O
</s>
<s>
Since	O
the	B-Language
mid-1990s	O
,	O
two	O
newer	O
variants	O
of	O
Rexx	B-Language
have	O
appeared	O
:	O
</s>
<s>
NetRexx	B-Language
:	O
compiles	B-Language
to	O
Java	B-Language
byte-code	O
via	O
Java	B-Language
source	I-Language
code	I-Language
;	O
this	O
has	O
no	O
reserved	O
keywords	O
at	O
all	O
,	O
and	O
uses	O
the	B-Language
Java	B-Language
object	O
model	O
,	O
and	O
is	O
therefore	O
not	O
generally	O
upwards-compatible	O
with	O
'	O
classic	O
 '	O
Rexx	B-Language
.	O
</s>
<s>
Object	B-Application
REXX	I-Application
:	O
an	O
object-oriented	B-Language
generally	O
upwards-compatible	O
version	O
of	O
Rexx	B-Language
.	O
</s>
<s>
In	O
1996	O
American	O
National	O
Standards	O
Institute	O
(	O
ANSI	O
)	O
published	O
a	O
standard	O
for	O
Rexx	B-Language
:	O
ANSI	O
X3.274	O
–	O
1996	O
"	O
Information	O
Technology	O
–	O
Programming	O
Language	O
REXX	B-Language
"	O
.	O
</s>
<s>
More	O
than	O
two	O
dozen	O
books	O
on	O
Rexx	B-Language
have	O
been	O
published	O
since	O
1985	O
.	O
</s>
<s>
Rexx	B-Language
marked	O
its	O
25th	O
anniversary	O
on	O
20	O
March	O
2004	O
,	O
which	O
was	O
celebrated	O
at	O
the	B-Language
REXX	B-Language
Language	O
Association	O
's	O
15th	O
International	O
REXX	B-Language
Symposium	O
in	O
Böblingen	O
,	O
Germany	O
,	O
in	O
May	O
2004	O
.	O
</s>
<s>
On	O
October	O
12	O
,	O
2004	O
,	O
IBM	O
announced	O
their	O
plan	O
to	O
release	O
their	O
Object	B-Application
REXX	I-Application
implementation	O
's	O
sources	O
under	O
the	B-Language
Common	O
Public	O
License	O
.	O
</s>
<s>
Recent	O
releases	O
of	O
Object	B-Application
REXX	I-Application
contain	O
an	O
ActiveX	O
Windows	B-Application
Scripting	B-Language
Host	O
(	O
WSH	O
)	O
scripting	B-Language
engine	I-Language
implementing	O
this	O
version	O
of	O
the	B-Language
Rexx	B-Language
language	O
.	O
</s>
<s>
On	O
February	O
22	O
,	O
2005	O
,	O
the	B-Language
first	O
public	O
release	O
of	O
Open	B-Application
Object	I-Application
Rexx	I-Application
(	O
ooRexx	B-Application
)	O
was	O
announced	O
.	O
</s>
<s>
This	O
product	O
contains	O
a	O
WSH	O
scripting	B-Language
engine	I-Language
which	O
allows	O
for	O
programming	O
of	O
the	B-Language
Windows	B-Application
operating	I-Application
system	I-Application
and	O
applications	O
with	O
Rexx	B-Language
in	O
the	B-Language
same	O
fashion	O
in	O
which	O
Visual	B-Language
Basic	I-Language
and	O
JScript	B-Language
are	O
implemented	O
by	O
the	B-Language
default	O
WSH	O
installation	O
and	O
Perl	B-Language
,	O
Tcl	B-Operating_System
,	O
Python	B-Language
third-party	O
scripting	B-Language
engines	I-Language
.	O
</s>
<s>
REXX	B-Language
was	O
listed	O
in	O
the	B-Language
TIOBE	O
index	O
as	O
one	O
of	O
the	B-Language
fifty	O
languages	O
in	O
its	O
top	O
100	O
not	O
belonging	O
to	O
the	B-Language
top	O
50	O
.	O
</s>
<s>
In	O
2019	O
,	O
the	B-Language
30th	O
Rexx	B-Language
Language	O
Association	O
Symposium	O
marked	O
the	B-Language
40th	O
anniversary	O
of	O
Rexx	B-Language
.	O
</s>
<s>
The	B-Language
symposium	O
was	O
held	O
in	O
Hursley	O
,	O
England	O
,	O
where	O
Rexx	B-Language
was	O
first	O
designed	O
and	O
implemented	O
.	O
</s>
<s>
Rexx/Tk	O
,	O
a	O
toolkit	O
for	O
graphics	O
to	O
be	O
used	O
in	O
Rexx	B-Language
programmes	O
in	O
the	B-Language
same	O
fashion	O
as	O
Tcl/Tk	B-Application
is	O
widely	O
available	O
.	O
</s>
<s>
A	O
Rexx	B-Language
IDE	O
,	O
RxxxEd	O
,	O
has	O
been	O
developed	O
for	O
Windows	B-Application
.	O
</s>
<s>
RxSock	O
for	O
network	O
communication	O
as	O
well	O
as	O
other	O
add-ons	O
to	O
and	O
implementations	O
of	O
Regina	O
Rexx	B-Language
have	O
been	O
developed	O
,	O
and	O
a	O
Rexx	B-Language
interpreter	B-Application
for	O
the	B-Language
Windows	B-Application
command	O
line	O
is	O
supplied	O
in	O
most	O
Resource	O
Kits	O
for	O
various	O
versions	O
of	O
Windows	B-Application
and	O
works	O
under	O
all	O
of	O
them	O
as	O
well	O
as	O
DOS	B-Device
.	O
</s>
<s>
Originally	O
the	B-Language
language	O
was	O
called	O
Rex	O
(	O
Reformed	O
Executor	O
)	O
;	O
the	B-Language
extra	O
"	O
X	O
"	O
was	O
added	O
to	O
avoid	O
collisions	O
with	O
other	O
products	O
 '	O
names	O
.	O
</s>
<s>
REX	O
was	O
originally	O
all	O
uppercase	O
because	O
the	B-Language
mainframe	B-Architecture
code	O
was	O
uppercase	O
oriented	O
.	O
</s>
<s>
The	B-Language
style	O
in	O
those	O
days	O
was	O
to	O
have	O
all-caps	O
names	O
,	O
partly	O
because	O
almost	O
all	O
code	O
was	O
still	O
all-caps	O
then	O
.	O
</s>
<s>
For	O
the	B-Language
product	O
it	O
became	O
REXX	B-Language
,	O
and	O
both	O
editions	O
of	O
Mike	O
Cowlishaw	O
's	O
book	O
use	O
all-caps	O
.	O
</s>
<s>
The	B-Language
expansion	O
to	O
REstructured	B-Language
eXtended	I-Language
eXecutor	I-Language
was	O
used	O
for	O
the	B-Language
system	O
product	O
in	O
1984	O
.	O
</s>
<s>
The	B-Language
loop	O
control	O
structure	O
in	O
Rexx	B-Language
begins	O
with	O
a	O
DO	O
and	O
ends	O
with	O
an	O
END	O
but	O
comes	O
in	O
several	O
varieties	O
.	O
</s>
<s>
NetRexx	B-Language
uses	O
the	B-Language
keyword	O
LOOP	O
instead	O
of	O
DO	O
for	O
looping	O
,	O
while	O
ooRexx	B-Application
treats	O
LOOP	O
and	O
DO	O
as	O
equivalent	O
when	O
looping	O
.	O
</s>
<s>
Rexx	B-Language
supports	O
a	O
variety	O
of	O
traditional	O
structured-programming	O
loops	O
while	O
testing	O
a	O
condition	O
either	O
before	O
(	O
do	O
while	O
)	O
or	O
after	O
(	O
do	O
until	O
)	O
the	B-Language
list	O
of	O
instructions	O
are	O
executed	O
:	O
</s>
<s>
Like	O
most	O
languages	O
,	O
Rexx	B-Language
can	O
loop	O
while	O
incrementing	O
an	O
index	O
variable	O
and	O
stop	O
when	O
a	O
limit	O
is	O
reached	O
:	O
</s>
<s>
The	B-Language
increment	O
may	O
be	O
omitted	O
and	O
defaults	O
to	O
1	O
.	O
</s>
<s>
The	B-Language
limit	O
can	O
also	O
be	O
omitted	O
,	O
which	O
makes	O
the	B-Language
loop	O
continue	O
forever	O
.	O
</s>
<s>
Rexx	B-Language
permits	O
counted	O
loops	O
,	O
where	O
an	O
expression	O
is	O
computed	O
at	O
the	B-Language
start	O
of	O
the	B-Language
loop	O
and	O
the	B-Language
instructions	O
within	O
the	B-Language
loop	O
are	O
executed	O
that	O
many	O
times	O
:	O
</s>
<s>
Rexx	B-Language
can	O
even	O
loop	O
until	O
the	B-Language
program	O
is	O
terminated	O
:	O
</s>
<s>
A	O
program	O
can	O
break	O
out	O
of	O
the	B-Language
current	O
loop	O
with	O
the	B-Language
leave	O
instruction	O
,	O
which	O
is	O
the	B-Language
normal	O
way	O
to	O
exit	O
a	O
do	O
forever	O
loop	O
,	O
or	O
can	O
short-circuit	O
it	O
with	O
the	B-Language
iterate	O
instruction	O
.	O
</s>
<s>
Like	O
PL/I	B-Language
,	O
Rexx	B-Language
allows	O
both	O
conditional	O
and	O
repetitive	O
elements	O
to	O
be	O
combined	O
in	O
the	B-Language
same	O
loop	O
:	O
</s>
<s>
The	B-Language
ELSE	O
clause	O
is	O
optional	O
.	O
</s>
<s>
Indentation	O
is	O
optional	O
,	O
but	O
it	O
helps	O
improve	O
the	B-Language
readability	O
.	O
</s>
<s>
SELECT	O
is	O
Rexx	B-Language
's	O
CASE	O
structure	O
,	O
like	O
many	O
other	O
constructs	O
derived	O
from	O
PL/I	B-Language
.	O
</s>
<s>
Like	O
some	O
implementations	O
of	O
CASE	O
constructs	O
in	O
other	O
dynamic	O
languages	O
,	O
Rexx	B-Language
's	O
WHEN	O
clauses	O
specify	O
full	O
conditions	O
,	O
which	O
need	O
not	O
be	O
related	O
to	O
each	O
other	O
.	O
</s>
<s>
In	O
that	O
,	O
they	O
are	O
more	O
like	O
cascaded	O
sets	O
of	O
IF-THEN-ELSEIF-THEN-...-ELSE	O
code	O
than	O
they	O
are	O
like	O
the	B-Language
C	O
or	O
Java	B-Language
switch	O
statement	O
.	O
</s>
<s>
The	B-Language
NOP	O
instruction	O
performs	O
"	O
no	O
operation	O
"	O
,	O
and	O
is	O
used	O
when	O
the	B-Language
programmer	O
wishes	O
to	O
do	O
nothing	O
in	O
a	O
place	O
where	O
one	O
or	O
more	O
instructions	O
would	O
be	O
required	O
.	O
</s>
<s>
The	B-Language
OTHERWISE	O
clause	O
is	O
optional	O
.	O
</s>
<s>
If	O
omitted	O
and	O
no	O
WHEN	O
conditions	O
are	O
met	O
,	O
then	O
the	B-Language
SYNTAX	O
condition	O
is	O
raised	O
.	O
</s>
<s>
Variables	O
in	O
Rexx	B-Language
are	O
typeless	O
,	O
and	O
initially	O
are	O
evaluated	O
as	O
their	O
names	O
,	O
in	O
upper	O
case	O
.	O
</s>
<s>
Thus	O
a	O
variable	O
's	O
type	O
can	O
vary	O
with	O
its	O
use	O
in	O
the	B-Language
program	O
:	O
</s>
<s>
Unlike	O
many	O
other	O
programming	O
languages	O
,	O
classic	O
Rexx	B-Language
has	O
no	O
direct	O
support	O
for	O
arrays	O
of	O
variables	O
addressed	O
by	O
a	O
numerical	O
index	O
.	O
</s>
<s>
(	O
dot	O
)	O
is	O
used	O
to	O
join	O
the	B-Language
stem	O
to	O
the	B-Language
tail	O
.	O
</s>
<s>
If	O
the	B-Language
tails	O
used	O
are	O
numeric	B-Algorithm
,	O
it	O
is	O
easy	O
to	O
produce	O
the	B-Language
same	O
effect	O
as	O
an	O
array	O
.	O
</s>
<s>
Afterwards	O
the	B-Language
following	O
variables	O
with	O
the	B-Language
following	O
values	O
exist	O
:	O
stem.1	O
=	O
9	O
,	O
stem.2	O
=	O
8	O
,	O
stem.3	O
=	O
7	O
...	O
</s>
<s>
Unlike	O
arrays	O
,	O
the	B-Language
index	O
for	O
a	O
stem	O
variable	O
is	O
not	O
required	O
to	O
have	O
an	O
integer	O
value	O
.	O
</s>
<s>
For	O
example	O
,	O
the	B-Language
following	O
code	O
is	O
valid	O
:	O
</s>
<s>
In	O
Rexx	B-Language
it	O
is	O
also	O
possible	O
to	O
set	O
a	O
default	O
value	O
for	O
a	O
stem	O
.	O
</s>
<s>
After	O
these	O
assignments	O
the	B-Language
term	O
stem.3	O
would	O
produce	O
'	O
Unknown	O
 '	O
.	O
</s>
<s>
The	B-Language
whole	O
stem	O
can	O
also	O
be	O
erased	O
with	O
the	B-Language
DROP	O
statement	O
.	O
</s>
<s>
This	O
also	O
has	O
the	B-Language
effect	O
of	O
removing	O
any	O
default	O
value	O
set	O
previously	O
.	O
</s>
<s>
By	O
convention	O
(	O
and	O
not	O
as	O
part	O
of	O
the	B-Language
language	O
)	O
the	B-Language
compound	O
stem.0	O
is	O
often	O
used	O
to	O
keep	O
track	O
of	O
how	O
many	O
items	O
are	O
in	O
a	O
stem	O
,	O
for	O
example	O
a	O
procedure	O
to	O
add	O
a	O
word	O
to	O
a	O
list	O
might	O
be	O
coded	O
like	O
this	O
:	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
have	O
multiple	O
elements	O
in	O
the	B-Language
tail	O
of	O
a	O
compound	O
variable	O
.	O
</s>
<s>
Multiple	O
numerical	O
tail	O
elements	O
can	O
be	O
used	O
to	O
provide	O
the	B-Language
effect	O
of	O
a	O
multi-dimensional	O
array	O
.	O
</s>
<s>
Features	O
similar	O
to	O
Rexx	B-Language
compound	O
variables	O
are	O
found	O
in	O
many	O
other	O
languages	O
(	O
including	O
associative	B-Application
arrays	I-Application
in	O
AWK	B-Application
,	O
hashes	B-Algorithm
in	O
Perl	B-Language
and	O
Hashtables	B-Algorithm
in	O
Java	B-Language
)	O
.	O
</s>
<s>
Most	O
of	O
these	O
languages	O
provide	O
an	O
instruction	O
to	O
iterate	O
over	O
all	O
the	B-Language
keys	O
(	O
or	O
tails	O
in	O
Rexx	B-Language
terms	O
)	O
of	O
such	O
a	O
construct	O
,	O
but	O
this	O
is	O
lacking	O
in	O
classic	O
Rexx	B-Language
.	O
</s>
<s>
For	O
example	O
,	O
in	O
a	O
program	O
to	O
count	O
words	O
the	B-Language
following	O
procedure	O
might	O
be	O
used	O
to	O
record	O
each	O
occurrence	O
of	O
a	O
word	O
.	O
</s>
<s>
At	O
the	B-Language
cost	O
of	O
some	O
clarity	O
it	O
is	O
possible	O
to	O
combine	O
these	O
techniques	O
into	O
a	O
single	O
stem	O
:	O
</s>
<s>
Rexx	B-Language
provides	O
no	O
safety	O
net	O
here	O
,	O
so	O
if	O
one	O
of	O
the	B-Language
words	O
happens	O
to	O
be	O
a	O
whole	O
number	O
less	O
than	O
dictionary.0	O
this	O
technique	O
will	O
fail	O
mysteriously	O
.	O
</s>
<s>
Recent	O
implementations	O
of	O
Rexx	B-Language
,	O
including	O
IBM	O
's	O
Object	B-Application
REXX	I-Application
and	O
the	B-Language
open	B-Application
source	I-Application
implementations	O
like	O
ooRexx	B-Application
include	O
a	O
new	O
language	B-Language
construct	I-Language
to	O
simplify	O
iteration	O
over	O
the	B-Language
value	O
of	O
a	O
stem	O
,	O
or	O
over	O
another	O
collection	O
object	O
such	O
as	O
an	O
array	O
,	O
table	O
or	O
list	O
.	O
</s>
<s>
The	B-Language
PARSE	O
instruction	O
is	O
particularly	O
powerful	O
;	O
it	O
combines	O
some	O
useful	O
string-handling	O
functions	O
.	O
</s>
<s>
where	O
origin	O
specifies	O
the	B-Language
source	O
:	O
</s>
<s>
displays	O
the	B-Language
following	O
:	O
</s>
<s>
also	O
displays	O
the	B-Language
following	O
:	O
</s>
<s>
displays	O
the	B-Language
following	O
:	O
</s>
<s>
The	B-Language
INTERPRET	O
instruction	O
evaluates	O
its	O
argument	O
and	O
treats	O
its	O
value	O
as	O
a	O
Rexx	B-Language
statement	O
.	O
</s>
<s>
Sometimes	O
INTERPRET	O
is	O
the	B-Language
clearest	O
way	O
to	O
perform	O
a	O
task	O
,	O
but	O
it	O
is	O
often	O
used	O
where	O
clearer	O
code	O
is	O
possible	O
using	O
,	O
e.g.	O
,	O
value( )	O
.	O
</s>
<s>
Other	O
uses	O
of	O
INTERPRET	O
are	O
Rexx	B-Language
's	O
(	O
decimal	O
)	O
arbitrary	B-Algorithm
precision	I-Algorithm
arithmetic	I-Algorithm
(	O
including	O
fuzzy	O
comparisons	O
)	O
,	O
use	O
of	O
the	B-Language
PARSE	O
statement	O
with	O
programmatic	O
templates	O
,	O
stemmed	O
arrays	O
,	O
and	O
sparse	O
arrays	O
.	O
</s>
<s>
Because	O
variable	O
contents	O
in	O
Rexx	B-Language
are	O
strings	O
,	O
including	O
rational	O
numbers	O
with	O
exponents	O
and	O
even	O
entire	O
programs	O
,	O
Rexx	B-Language
offers	O
to	O
interpret	O
strings	O
as	O
evaluated	O
expressions	O
.	O
</s>
<s>
Rexx	B-Language
offers	O
only	O
basic	O
math	O
functions	O
like	O
ABS	O
,	O
DIGITS	O
,	O
MAX	O
,	O
MIN	O
,	O
SIGN	O
,	O
RANDOM	O
,	O
and	O
a	O
complete	O
set	O
of	O
hex	O
plus	O
binary	O
conversions	O
with	O
bit	O
operations	O
.	O
</s>
<s>
More	O
complex	O
functions	O
like	O
SIN	O
were	O
implemented	O
from	O
scratch	O
or	O
obtained	O
from	O
third	O
party	O
external	O
libraries	B-Library
.	O
</s>
<s>
Some	O
external	O
libraries	B-Library
,	O
typically	O
those	O
implemented	O
in	O
traditional	O
languages	O
,	O
did	O
not	O
support	O
extended	O
precision	O
.	O
</s>
<s>
Together	O
with	O
the	B-Language
built-in	O
function	O
VALUE	O
,	O
CALL	O
can	O
be	O
used	O
in	O
place	O
of	O
many	O
cases	O
of	O
INTERPRET	O
.	O
</s>
<s>
A	O
slightly	O
more	O
sophisticated	O
"	O
Rexx	B-Language
calculator	O
"	O
:	O
</s>
<s>
The	B-Language
power	O
of	O
the	B-Language
INTERPRET	O
instruction	O
had	O
other	O
uses	O
.	O
</s>
<s>
The	B-Language
Valour	B-Application
software	I-Application
package	O
relied	O
upon	O
Rexx	B-Language
's	O
interpretive	O
ability	O
to	O
implement	O
an	O
OOP	B-Language
environment	B-Device
.	O
</s>
<s>
The	B-Language
SIGNAL	O
instruction	O
is	O
intended	O
for	O
abnormal	O
changes	O
in	O
the	B-Language
flow	O
of	O
control	O
(	O
see	O
the	B-Language
next	O
section	O
)	O
.	O
</s>
<s>
However	O
,	O
it	O
can	O
be	O
misused	O
and	O
treated	O
like	O
the	B-Language
GOTO	B-Application
statement	O
found	O
in	O
other	O
languages	O
(	O
although	O
it	O
is	O
not	O
strictly	O
equivalent	O
,	O
because	O
it	O
terminates	O
loops	O
and	O
other	O
constructs	O
)	O
.	O
</s>
<s>
It	O
is	O
possible	O
in	O
Rexx	B-Language
to	O
intercept	O
and	O
deal	O
with	O
errors	O
and	O
other	O
exceptions	O
,	O
using	O
the	B-Language
SIGNAL	O
instruction	O
.	O
</s>
<s>
Handling	O
of	O
each	O
can	O
be	O
switched	O
on	O
and	O
off	O
in	O
the	B-Language
source	O
code	O
as	O
desired	O
.	O
</s>
<s>
The	B-Language
following	O
program	O
will	O
run	O
until	O
terminated	O
by	O
the	B-Language
user	O
:	O
</s>
<s>
Regardless	O
of	O
the	B-Language
state	O
of	O
the	B-Language
NOVALUE	O
condition	O
,	O
the	B-Language
status	O
of	O
a	O
variable	O
can	O
always	O
be	O
checked	O
with	O
the	B-Language
built-in	O
function	O
SYMBOL	O
returning	O
VAR	O
for	O
defined	O
variables	O
.	O
</s>
<s>
The	B-Language
VALUE	O
function	O
can	O
be	O
used	O
to	O
get	O
the	B-Language
value	O
of	O
variables	O
without	O
triggering	O
a	O
NOVALUE	O
condition	O
,	O
but	O
its	O
main	O
purpose	O
is	O
to	O
read	O
and	O
set	O
environment	B-Device
variables	O
,	O
similar	O
to	O
POSIX	O
getenv	O
and	O
putenv	O
.	O
</s>
<s>
When	O
a	O
condition	O
is	O
handled	O
by	O
SIGNAL	O
ON	O
,	O
the	B-Language
SIGL	O
and	O
RC	O
system	O
variables	O
can	O
be	O
analyzed	O
to	O
understand	O
the	B-Language
situation	O
.	O
</s>
<s>
RC	O
contains	O
the	B-Language
Rexx	B-Language
error	O
code	O
and	O
SIGL	O
contains	O
the	B-Language
line	O
number	O
where	O
the	B-Language
error	O
arose	O
.	O
</s>
<s>
Beginning	O
with	O
Rexx	B-Language
version	O
4	O
conditions	O
can	O
get	O
names	O
,	O
and	O
there	O
's	O
also	O
a	O
CALL	O
ON	O
construct	O
.	O
</s>
