REXX |
||||
|
The REXX (Restructured Extended Executor) programming language was designed and implemented between 1979 and 1982 by Mike Cowlishaw of IBM. It is a modern, structured, high-level programming language that was designed to be both easy to learn and easy to read. This was achieved by implementing the following characteristics and features:
REXX has just twenty-three, largely self-evident keywords (ie, CALL, PARSE, SELECT) and minimial punctuation requirements. It is essentially a free-form language with only one data-type, the character string; users never have to worry about data conversion. REXX looks a lot like PL/1[?].
HistoryOriginally a scripting language developed at IBM. REXX was the successor to the script languages EXEC and EXEC 2. It was also designed to be a macro or scripting language for any system. As such, it is a precursor to TCL[?] and Python. Over the years IBM developed versions for many of its operating systems: VM/CMS, OS/2, PC-DOS, MVS/TSO, AS/400, and AIX. Non-IBM versions have also been developed for Atari, Unix, DEC, Windows, and MS-DOS. Later versions of the Amiga OS included a version of REXX called AREXX. Several freeware versions are available. REXX/IMC and Regina are the most widely-used open-source ports to Windows and Linux. In 1996 ANSI published a standard for REXX: ANSI X3.274-1996 "Information Technology - Programming Language REXX" In recent years, two newer variants of REXX have appeared:
Syntax
LoopingThe DO control structure always begins with a DO and ends with an END.
DO UNTIL:
DO WHILE:
Stepping through a variable:
Looping forever until exiting with LEAVE:
Looping a fixed number of times
ConditionalsTesting conditions with IF
For single instructions, DO and END can also be omitted:
Testing for multiple conditions
SELECT is REXX's CASE structure
NOP indicates no instruction is to be executed.
PARSEThe PARSE instruction is particularly powerful; it combines some useful string-handling functions. Its syntax is:
where origin specifies the source:
and template can be:
upper is optional; it you specify it, data will be converted to upper case. Examples: Using a list of variables as template
displays the following
Using a delimiter as template:
also displays the following
Using column number delimiters:
displays the following
A template can use a combination of variables, literal delimiters, and column number delimiters.
Under OS/2REXX is included in the base operating system of OS/2, and is also used as the macro language in many applications. Under OS/2, a REXX program begins with matched comment delineaters, /* */, to indicate to the OS that it is a REXX program:
Instructions between quotes are passed to the OS:
SpellingCowlishaw seems to prefer Rexx, whereas IBM sales, ANSI, and the majority of the web uses REXX.
External Links
|
||||
Placing this code on your page will help others |
||||