FACTOID # 1: Idaho produces more milk than Iowa, Indiana and Illinois combined.
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "REXX" also viewed:
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > REXX
REXX
Paradigm: multi-paradigm: object-oriented, procedural, structured
Appeared in: 1979
Designed by: Mike Cowlishaw
Developer: Mike Cowlishaw & IBM
Typing discipline: dynamic, everything is a string
Major implementations: IBM NetREXX, Open Object Rexx, Regina, others
Dialects: Open Object REXX, NetRexx
Influenced by: PL/I, EXEC 2, BASIC
Influenced: ECMAScript

REXX (REstructured eXtended eXecutor) is an interpreted programming language which was developed at IBM. It is a structured high-level programming language which was designed to be both easy to learn and easy to read. Both commercial and open source interpreters for REXX are available on a wide range of computing platforms, and compilers are available for IBM mainframes. A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). ... A multiparadigm programming language is a programming language that supports more than one programming paradigm. ... Object-oriented programming (OOP) is a programming paradigm that uses objects to design applications and computer programs. ... This does not adequately cite its references or sources. ... Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. ... For the song by the Smashing Pumpkins, see 1979 (song). ... Mike Cowlishaw is an IBM Fellow based at IBM UK’s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and an elected Fellow of the Royal Academy of Engineering (roughly the equivalent of the NAE in the USA). ... A software developer is a person who is concerned with one or more facets of the software development process, a somewhat broader scope of computer programming or a specialty of project managing. ... International Business Machines Corporation (known as IBM or Big Blue; NYSE: IBM) is a multinational computer technology corporation headquartered in Armonk, New York, USA. The company is one of the few information technology companies with a continuous history dating back to the 19th century. ... In computer science, a type system defines how a programming language classifies values and expressions into types, how it can manipulate those types and how they interact. ... In computer science, a type system defines how a programming language classifies values and expressions into types, how it can manipulate those types and how they interact. ... In various branches of mathematics and computer science, strings are sequences of various simple objects (symbols, tokens, characters, etc. ... Look up Implementation in Wiktionary, the free dictionary. ... A dialect of a programming language is a (relatively small) variation or extension of the language that does not change its intrinsic nature. ... The Object REXX programming language is an object-oriented scripting language based on the REXX language, produced by IBM, originally for the OS/2 line of operating systems. ... NetRexx is IBMs implementation of the Rexx programming language to run on the Java virtual machine. ... PL/I (Programming Language One, pronounced pee el one) is an imperative computer programming language designed for scientific, engineering, and business applications. ... EXEC 2 is an interpreted, command procedure control, computer programming language used by the EXEC 2 Processor supplied with the IBM Virtual Machine/Conversational Monitor System (VM/CMS) operating system. ... Screenshot of Atari BASIC, an early BASIC language for small computers. ... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... In computer programming, an interpreted language is a programming language whose programs may be executed from source form, by an interpreter. ... A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. ... International Business Machines Corporation (IBM, or colloquially, Big Blue) (NYSE: IBM) (incorporated June 15, 1911, in operation since 1888) is headquartered in Armonk, New York, USA. The company manufactures and sells computer hardware, software, and services. ... Open source refers to projects that are open to the public and which draw on other projects that are freely available to the general public. ... An interpreter is a computer program that executes other programs. ...

Contents

Features

REXX has the following characteristics and features:

  • character string basis
  • dynamic data typing (no declarations)
  • no reserved keywords (except in local context)
  • arbitrary numerical precision
  • decimal arithmetic (floating-point)
  • a rich selection of built-in functions (especially string and word processing)
  • automatic storage management
  • crash protection
  • associative arrays
  • straightforward access to system commands and facilities
  • simple error-handling, and built-in tracing and debugger
  • few artificial limitations
  • simplified I/O facilities.

REXX has just twenty-three, largely self-evident, instructions (e.g., call, parse, and select) with minimal punctuation and formatting requirements. It is essentially an almost free-form language with only one data-type, the character string; this philosophy means that all data are visible (symbolic) and debugging and tracing are simplified. In various branches of mathematics and computer science, strings are sequences of various simple objects (symbols, tokens, characters, etc. ... In most compiled computer languages, like C, C++, Pascal . ... On a computer, arbitrary-precision arithmetic, also called bignum arithmetic, is a technique that allows computer programs to perform calculations on integers or rational numbers (including floating-point numbers) with an arbitrary number of digits of precision, typically limited only by the available memory of the host system. ... This article or section is in need of attention from an expert on the subject. ... An associative array (also map, hash, dictionary, finite map, lookup table, and in query-processing an index or index file) is an abstract data type composed of a collection of keys and a collection of values, where each key is associated with one value. ... In computer programming, a free-form language is a programming language in which the positioning of characters on the page in program text is not significant. ...


REXX syntax looks similar to PL/I, but has fewer notations; this makes it harder to parse (by program) but easier to use. PL/I (Programming Language One, pronounced pee el one) is an imperative computer programming language designed for scientific, engineering, and business applications. ...


History

REXX was designed and first implemented as an ‘own-time’ project between 20 March 1979 and mid-1982 by Mike Cowlishaw of IBM, originally as a scripting programming language to replace the languages EXEC and EXEC 2[1]. It was designed to be a macro or scripting language for any system. As such, REXX is considered a precursor to Tcl and Python. March 20 is the 79th day of the year in the Gregorian Calendar (80th in leap years). ... For the song by the Smashing Pumpkins, see 1979 (song). ... 1982 (MCMLXXXII) was a common year starting on Friday of the Gregorian calendar. ... Mike Cowlishaw is an IBM Fellow based at IBM UK’s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and an elected Fellow of the Royal Academy of Engineering (roughly the equivalent of the NAE in the USA). ... Scripting programming languages (commonly called scripting languages or script languages) are computer programming languages designed for scripting the operation of a computer. ... CMS EXEC, or EXEC, is an interpreted, command procedure control, computer programming language used by the CMS EXEC Processor supplied with the IBM Virtual Machine/Conversational Monitor System (VM/CMS) operating system. ... EXEC 2 is an interpreted, command procedure control, computer programming language used by the EXEC 2 Processor supplied with the IBM Virtual Machine/Conversational Monitor System (VM/CMS) operating system. ... A macro in computer science is an abstraction, that defines how a certain input pattern is replaced by an output pattern according to a defined set of rules. ... Tcl (originally from Tool Command Language, but nonetheless conventionally rendered as Tcl rather than TCL; and pronounced like tickle) is a scripting language created by John Ousterhout. ... Python is a high-level programming language first released by Guido van Rossum in 1991. ...


It was first described in public at the SHARE 56 conference in Houston, Texas, in 1981[2], where customer reaction, championed by Ted Johnston of SLAC, led to it being shipped as an IBM product in 1982. 1981 (MCMLXXXI) was a common year starting on Thursday of the Gregorian calendar. ... The Stanford Linear Accelerator Center (SLAC) is a U.S. national laboratory operated by Stanford University for the U.S. Department of Energy. ... 1982 (MCMLXXXII) was a common year starting on Friday of the Gregorian calendar. ...


Over the years IBM included REXX in almost all of its operating systems (VM/CMS, VM/GCS, MVS TSO/E, AS/400, VSE/ESA, AIX, CICS/ESA, PC-DOS, and OS/2), and has made versions available for Novell NetWare, Windows, Java, and Linux. VM/CMS (Virtual Machine/Conversational Monitor System, originally called CP/CMS when it first appeared) is a bundled pair of operating systems used on IBM System/360, System/370, System/390, zSeries, and System z9 mainframes (and compatible systems). ... MVS (Multiple Virtual Storage) was the most commonly used operating system on the System/370 and System/390 IBM mainframe computers. ... i5 Model 570 (2006) The Application System/400 (also known as AS/400, iSeries (since 2000) and System i5 (since 2006)) is a type of minicomputer produced by IBM. It was first produced in 1988 and, as of 2006, is still in production. ... AIX (Advanced Interactive eXecutive) is a proprietary operating system developed by IBM based on UNIX System V. Before the product was ever marketed, the acronym AIX originally stood for Advanced IBM UNIX. AIX has pioneered numerous network operating system enhancements, introducing new innovations later adopted by Unix-like operating systems... IBM PC-DOS was one of the three major operating systems that dominated the personal computer market from about 1985 to 1995. ... To meet Wikipedias quality standards, this article or section may require cleanup. ... NetWare is a network operating system developed by Novell, Inc. ... Microsoft Windows is the name of several families of proprietary software operating systems by Microsoft. ... Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family. ...


The first non-IBM version was written for PC-DOS by Charles Daney in 1984/5. Other versions have also been developed for Atari, Amiga, Unix (many variants), Solaris, DEC, Windows, Windows CE, PocketPC, MS-DOS, Palm OS, QNX, OS/2, Linux, BeOS, EPOC32, AtheOS, OpenVMS, OpenEdition, Macintosh, and Mac OS X. [3] IBM PC-DOS was one of the three major operating systems that dominated the personal computer market from about 1985 to 1995. ... This article is about a corporate game company. ... The original Amiga 1000 (1985) with various peripherals The Amiga is a family of home/personal computers originally developed by Amiga Corporation as an advanced home entertainment and productivity machine. ... Filiation of Unix and Unix-like systems Unix (officially trademarked as UNIX®) is a computer operating system originally developed in the 1960s and 1970s by a group of AT&T employees at Bell Labs including Ken Thompson, Dennis Ritchie and Douglas McIlroy. ... Solaris is a computer operating system developed by Sun Microsystems. ... The DEC logo Digital Equipment Corporation was a pioneering American company in the computer industry. ... Microsoft Windows is the name of several families of proprietary software operating systems by Microsoft. ... This article or section does not cite its references or sources. ... A Pocket PC is a computer in a handheld size that runs a variation of the operating system Windows CE. It has many capabilities of modern desktop PCs. ... Microsofts disk operating system, MS-DOS, was Microsofts implementation of DOS, which was the first popular operating system for the IBM PC, and until recently, was widely used on the PC compatible platform. ... Palm OS is a compact operating system developed and licensed by PalmSource, Inc. ... QNX (pronounced either Q-N-X or Q-nix) is a commercial POSIX-compliant Unix-like real-time operating system, aimed primarily at the embedded systems market. ... To meet Wikipedias quality standards, this article or section may require cleanup. ... Linux (IPA pronunciation: ) is a Unix-like computer operating system family. ... BeOS is an operating system for personal computers which began development by Be Inc. ... EPOC is a range of operating systems developed by Psion for portable devices, primarily PDAs. ... AtheOS was a free Unix_like operating system for x86-based computers. ... OpenVMS[1] (Open Virtual Memory System or just VMS) is the name of a high-end computer server operating system that runs on the VAX[2] and Alpha[3] family of computers developed by Digital Equipment Corporation of Maynard, Massachusetts (DIGITAL was then purchased by Compaq, and is now owned... OpenEdition is a POSIX compatible environment present in IBM MVS. Categories: Substubs ... The first Macintosh computer, introduced in 1984, upgraded to a 512K Fat Mac. The Macintosh or Mac, is a line of personal computers designed, developed, manufactured, and marketed by Apple Computer. ... Mac OS X (official IPA pronunciation: ) is a line of proprietary, graphical operating systems developed, marketed, and sold by Apple Inc. ...


The Amiga version of Rexx, called ARexx was included with AmigaOS 2 onwards and was popular for scripting as well as application control. Many Amiga applications have "ARexx ports" built into them which allows control of the application via a user defined script. The original Amiga 1000 (1985) with various peripherals The Amiga is a family of home/personal computers originally developed by Amiga Corporation as an advanced home entertainment and productivity machine. ... ARexx is the Amiga version of scripting language REXX by IBM. It has been not licensed from IBM, but it is a version written by Bill Hawes who ported REXX to the Amiga, with many special Amiga features. ...


Several freeware versions of Rexx are available. In 1992, the two most widely-used open-source ports appeared: Ian Collier's REXX/imc for Unix and Anders Christensen's Regina (later adopted by Mark Hessling) for Windows and Linux. BREXX is well-known for WinCE and PocketPC platforms. 1992 (MCMXCII) was a leap year starting on Wednesday. ... It has been suggested that Open source culture be merged into this article or section. ...


In 1996 ANSI published a standard for REXX: ANSI X3.274–1996 “Information Technology – Programming Language REXX”. More than two dozen books on REXX have been published since 1985. 1996 (MCMXCVI) was a leap year starting on Monday of the Gregorian calendar, and was designated the International Year for the Eradication of Poverty. ... The American National Standards Institute (ANSI) is a private, non-profit standards organization that produces industrial standards in the United States. ... 1985 (MCMLXXXV) was a common year starting on Tuesday of the Gregorian calendar. ...


Since the mid-1990s, two newer variants of REXX have appeared: The 1990s decade refers to the years from the start of 1990 to the end of 1999. ...

  • NetRexx – which compiles to Java byte-code via Java source code; this has no reserved keywords at all, and uses the Java object model, and is therefore not upwards-compatible with ‘classic’ REXX.
  • Object Rexx – which is an object-oriented upwards-compatible version of REXX.

In 1990, Cathy Dager of SLAC organized the first independent REXX symposium, which led to the forming of the REXX Language Association. Symposiums are held annually. NetRexx is IBMs implementation of the Rexx programming language to run on the Java virtual machine. ... Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. ... Byte-code is a sort of intermediate code that is more abstract than machine code. ... The Object REXX programming language is an object-oriented scripting language based on the REXX language, produced by IBM, originally for the OS/2 line of operating systems. ... Object-oriented programming (OOP) is a computer programming paradigm in which a software system is modeled as a set of objects that interact with each other. ... MCMXC redirects here; for the Enigma album, see MCMXC a. ...


Rexx marked its 25th anniversary on 20 March 2004, which was celebrated at the REXX Language Association’s 15th International REXX Symposium in Böblingen, Germany, in May 2004. March 20 is the 79th day of the year in the Gregorian Calendar (80th in leap years). ... 2004 (MMIV) was a leap year starting on Thursday of the Gregorian calendar. ...


On October 12, 2004, IBM announced their plan to release their Object Rexx implementation under the Common Public License. October 12 is the 285th day of the year in the Gregorian calendar (286th in leap years). ... 2004 (MMIV) was a leap year starting on Thursday of the Gregorian calendar. ... The Object REXX programming language is an object-oriented scripting language based on the REXX language, produced by IBM, originally for the OS/2 line of operating systems. ... The CPL (Common Public License) is a free software / open-source software license published by IBM. Its license terms have been approved by the Open Source Initiative and Free Software Foundation. ...


On February 22, 2005, the first public release of ooRexx (Open Object Rexx) was announced. February 22 is the 53rd day of the year in the Gregorian calendar. ... 2005 (MMV) was a common year starting on Saturday of the Gregorian calendar. ...


Spelling

In plain text, Cowlishaw seems to prefer Rexx, whereas IBM documents and the majority of the web uses REXX. The ANSI standard uses the form preferred by the standardization committee, which has small capitals for the final three letters: REXX. This style is also used on the cover pages of "The Rexx Language" TRL and "The NetRexx Language" written by Michael Cowlishaw. Originally it was just called "Rex" because the author liked how it sounded, the extra "x" was added to avoid collisions with other products' names. The expansion of Rexx to the Restructured Extended Executor is a bacronym. A backronym or bacronym is a reverse acronym, that is, the words of the expanded term were chosen to fit the letters of the acronym. ...


Syntax

Looping

The loop control structure in Rexx always begins with a DO and ends with an END but comes in several varieties.


Traditional forms:

  do until [condition] [instructions] end  
  do while [condition] [instructions] end  

With an index variable:

  do i = x [to y ][by z] [instructions] end  

The step increment (z above) may be omitted and defaults to 1. The upper limit (y above) can also be omitted, which makes the loop continue forever. You can also loop forever without an index variable with this:

  do forever [instructions] end  

A program can break out of the current loop with the leave instruction (which is the normal way to exit a "forever" loop), or can short-circuit it with the iterate instruction. The do while and do until forms are equivalent to:

  do forever if [condition] then leave [instructions] end  

and:

  do forever [instructions] if [condition] then leave end  

Conditionals

Testing conditions with IF

  if [condition] then do [instructions] end else do [instructions] end  

For single instructions, DO and END can also be omitted:

  if [condition] then [instruction] else [instruction]  

Testing for multiple conditions

SELECT is REXX's CASE structure, like many other constructs derived from PL/I: PL/I (Programming Language One, pronounced pee el one) is an imperative computer programming language designed for scientific, engineering, and business applications. ...

  select when [condition] then [instruction] when [condition] then do [instructions] end otherwise [instructions] or NOP end  

NOP indicates no instruction is to be executed.


Simple Variables

Variables in REXX are typeless, and initially are evaluated as their names, in upper case. Thus a variable's type can vary with its use in the program:

  say hello /* => HELLO */ hello = 25 say hello /* => 25 */ hello = "say 5 + 3" say hello /* => say 5 + 3 */ interpret hello /* => 8 */ drop hello say hello /* => HELLO */  

Compound variables

Unlike many other programming languages, classic REXX has no direct support for arrays of variables addressed by a numerical index. Instead it provides compound variables. A compound variable consists of a stem followed by a tail. A . (dot) is used to join the stem to the tail. If the tails used are numeric, it is easy to produce the same effect as an array.

  do i = 1 to 10 stem.i = 10 - i end  

Afterwards the following variables with the following values exist: stem.1 = 9, stem.2 = 8, stem.3 = 7...


Unlike arrays, the index for a stem variable is not required to have an integer value. For example, the following code is valid:

  i = 'Monday' stem.i = 2  

In Rexx it is also possible to set a default value for a stem.

  stem. = 'Unknown' stem.1 = 'USA' stem.44 = 'UK' stem.33 = 'France'  

After these assignments the term stem.3 would produce 'Unknown'.


The whole stem can also be erased with the DROP statement.

  drop stem.  

This also has the effect of removing any default value set previously.


By convention (and not as part of the language) the compound stem.0 is often used to keep track of how many items are in a stem, for example a procedure to add a word to a list might be coded like this:

  add_word: procedure expose dictionary. parse arg w n = dictionary.0 + 1 dictionary.n = w dictionary.0 = n return  

It is also possible to have multiple elements in the tail of a compound variable. For example:

  m = 'July' d = 15 y = 2005 day.y.m.d = 'Friday'  

Multiple numerical tail elements can be used to provide the effect of a multi-dimensional array.


Features similar to Rexx compound variables are found in many other languages (associative arrays in AWK, hashes in Perl, Vectors in Java, etc). Most of these languages provide an instruction to iterate over all the keys (or tails in Rexx terms) of such a construct, but this is lacking in classic Rexx. Instead it is necessary to keep auxiliary lists of tail values as appropriate. For example in a program to count words the following procedure might be used to record each occurrence of a word. An associative array (also map, hash, dictionary, finite map, lookup table, and in query-processing an index or index file) is an abstract data type composed of a collection of keys and a collection of values, where each key is associated with one value. ... AWK is a general purpose computer language that is designed for processing text-based data, either in files or data streams. ... In computer science, a hash table is a data structure that speeds up searching for information by a particular aspect of that information, called a key. ... Perl is a dynamic programming language created by Larry Wall and first released in 1987. ... Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. ...

  add_word: procedure expose count. word_list parse arg w . count.w = count.w + 1 /* assume count. has been set to 0 */ if count.w = 1 then word_list = word_list w return  

and then later

  do i = 1 to words(word_list) w = word(word_list,i) say w count.w end  

At the cost of some opacity it is possible to combine these techniques into a single stem.

  add_word: procedure expose dictionary. parse arg w . dictionary.w = dictionary.w + 1 if dictionary.w = 1 /* assume dictionary. = 0 */ then do n = dictionary.0+1 dictionary.n = w dictionary.0 = n end return  

and later

  do i = 1 to dictionary.0 w = dictionary.i say i w dictionary.w end  

However Rexx provides no safety net here, so if one of your words happens to be a whole number less than dictionary.0 the above technique will fail mysteriously.


Recent implementations of Rexx, include IBM's Object Rexx and the open source implementations like Regina and OORexx include a new language construct to simplify iteration over the value of a stem. International Business Machines Corporation (known as IBM or Big Blue; NYSE: IBM) is a multinational computer technology corporation headquartered in Armonk, New York, USA. The company is one of the few information technology companies with a continuous history dating back to the 19th century. ...

  do i over stem. say i '-->' stem.i end  

Keyword instructions

PARSE

The PARSE instruction is particularly powerful; it combines some useful string-handling functions. Its syntax is:

  parse [upper] origin template  

where origin specifies the source:

  • arg (arguments, at top level tail of command line)
  • linein (standard input, e.g. keyboard)
  • pull (REXX data queue or standard input)
  • source (info on how program was executed)
  • value (an expression) with
    the keyword with is required to indicate where the expression ends
  • var (a variable)
  • version (version/release number)

and template can be:

  • list of variables
  • column number delimiters
  • literal delimiters

upper is optional; it you specify it, data will be converted to upper case.


Examples:


Using a list of variables as template

  myVar = "John Smith" parse var myVar firstName lastName say "First name is:" firstName say "Last name is:" lastName  

displays the following:

  First name is: John Last name is: Smith  

Using a delimiter as template:

  myVar = "Smith, John" parse var myVar LastName "," FirstName say "First name is:" firstName say "Last name is:" lastName  

also displays the following:

  First name is: John Last name is: Smith  

Using column number delimiters:

  myVar = "(202) 123-1234" parse var MyVar 2 AreaCode 5 7 SubNumber say "Area code is:" AreaCode say "Subscriber number is:" SubNumber  

displays the following:

  Area code is: 202 Subscriber number is: 123-1234  

A template can use a combination of variables, literal delimiters, and column number delimiters.


INTERPRET

The INTERPRET instruction is very powerful and one of the two reasons why writing REXX compilers isn't trivial, the other reason being REXX' decimal arbitrary precision arithmetic:

  /* a touch of LISP */ X = 'square' interpret 'say' X || '(4) ; exit' SQUARE: return arg(1) * arg(1)  

This displays 16 and exits. Because anything in REXX are strings, even rational numbers with exponents, and last but not least complete programs, REXX offers to interpret strings as programs. Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax. ...


This feature was used to implement something like function parameters, e.g. passing SIN, COS, etc. to a procedure SIMPSON to calculate integrals.


Note that REXX offers only basic math functions like ABS, DIGITS, MAX, MIN, SIGN, RANDOM, and a complete set of hex plus binary conversions with bit operations. Anything else like SIN has to be implemented from scratch or using external libraries. The latter typically don't support arbitrary precision.


Later versions (non-classic) support CALL variable constructs. Together with the built-in function VALUE, CALL allows to avoid many cases of INTERPRET. This is a classic program:

  /* terminated by input "exit" or similar */ do forever ; interpret linein() ; end  

A slightly more sophisticated REXX calculator:

  X = 'input BYE to quit' do until X = 'BYE' ; interpret 'say' X ; pull X ; end  

PULL is a shorthand for parse upper pull like ARG for parse upper arg.


NUMERIC

  say digits() fuzz() form() /* => 9 0 SCIENTIFIC */ say 999999999 + 1 /* => 1.000000000E+9 */ numeric digits 10 /* only limited by available memory */ say 999999999 + 1 /* => 1000000000 */  
  say 0.9999999999 = 1 /* => 0 (false) */ numeric fuzz 3 say 0.99999999 = 1 /* => 1 (true) */ say 0.99999999 == 1 /* => 0 (false) */  
  say 100 * 123456789 /* => 1.23456789E+10 */ numeric form engineering say 100 * 123456789 /* => 12.34567890E+9 */  

SIGNAL

The REXX SIGNAL instruction is intended for abnormal changes in the flow of control (see the next section). However, it can be misused and treated like the GOTO statement found in other languages (although it is not strictly equivalent, because it terminates loops and other constructs). This can produce difficult to read code. Goto may mean: GOTO (also known as Goto or Go to) – a branching construct in programming languages, infamous for its role in unstructured dialects of BASIC Goto, Nagasaki – a Japanese city G0-T0 (note: the characters following the G and T, respectively, are zeros), alias his coverup identity of Goto...


Error handling and exceptions

It is possible in REXX to intercept and deal with errors and other exceptions, using the SIGNAL instruction. There are seven system conditions: ERROR, FAILURE, HALT, NOVALUE, NOTREADY, LOSTDIGITS and SYNTAX. Handling of each can be switched on and off in the source code as desired.


This example will run until stopped by the user:

  signal on halt; do a = 1 say a do 100000 /* a delay */ end end halt: say "The program was stopped by the user" exit  

Virtually all serious REXX programs contain signal on novalue or a similar statement. This disables the "feature", where undefined variables get their own (upper case) name as value. The status of a variable can be checked with the built-in function SYMBOL returning VAR for defined variables.


Function VALUE can be used to get the value of variables without triggering a NOVALUE condition, but its main purpose is to read and set environment variables - similar to POSIX getenv and putenv. POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ...


Conditions

ERROR Positive RC from a system command
FAILURE Negative RC for a system command (e.g. command doesn't exist)
HALT Abnormal termination (see above)
NOVALUE An unset variable was referenced (see above)
NOTREADY Input or output error (e.g. read attempts beyond end of file)
SYNTAX Invalid program syntax, or some error condition not covered above
LOSTDIGITS Significant digits are lost (ANSI REXX, not in TRL second edition)

When a condition is handled by SIGNAL ON, the SIGL and RC system variables can be analyzed to understand the situation. RC contains the REXX error code and SIGL contains the line number where the error arose.


Beginning with REXX version 4 conditions can get names, and there's also a CALL ON construct. That's handy if external functions do not necessarily exist:

  ChangeCodePage: procedure /* protect SIGNAL settings */ signal on syntax name ChangeCodePage.Trap return SysQueryProcessCodePage() ChangeCodePage.Trap: return 1004 /* windows-1252 on OS/2 */  

See also

  • ARexx - The native REXX interpreter of AmigaOS
  • XEDIT - text editor(s) with native REXX support

ARexx is the Amiga version of scripting language REXX by IBM. It has been not licensed from IBM, but it is a version written by Bill Hawes who ported REXX to the Amiga, with many special Amiga features. ... AmigaOS is the default native operating system of the Amiga personal computer. ... A visual editor for VM/CMS using block mode IBM 3270 terminals. ...

References

  1. ^ Cowlishaw, Mike. IBM REXX Brief History. IBM. Retrieved on 2006-08-15.
  2. ^ Cowlishaw, Mike (1981-02-18). REX -- A Command Programming Language. SHARE. Retrieved on 2006-08-15.
  3. ^ Rexx Implementations. RexxLA. Retrieved on 2006-08-15.

Mike Cowlishaw is an IBM Fellow based at IBM UK’s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and an elected Fellow of the Royal Academy of Engineering (roughly the equivalent of the NAE in the USA). ... International Business Machines Corporation (known as IBM or Big Blue; NYSE: IBM) is a multinational computer technology corporation headquartered in Armonk, New York, USA. The company is one of the few information technology companies with a continuous history dating back to the 19th century. ... For the Manfred Mann album, see 2006 (album). ... August 15 is the 227th day of the year in the Gregorian calendar (228th in leap years), with 138 days remaining. ... Mike Cowlishaw is an IBM Fellow based at IBM UK’s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and an elected Fellow of the Royal Academy of Engineering (roughly the equivalent of the NAE in the USA). ... 1981 (MCMLXXXI) was a common year starting on Thursday of the Gregorian calendar. ... February 18 is the 49th day of the year in the Gregorian calendar. ... SHARE Inc. ... For the Manfred Mann album, see 2006 (album). ... August 15 is the 227th day of the year in the Gregorian calendar (228th in leap years), with 138 days remaining. ... For the Manfred Mann album, see 2006 (album). ... August 15 is the 227th day of the year in the Gregorian calendar (228th in leap years), with 138 days remaining. ...

Books

  • The Rexx Language: A Practical Approach to Programming ( Prentice Hall, 1990), by Michael Cowlishaw, ISBN 0-13-780651-5
  • The NetRexx Language ( Prentice Hall, 1997), by Michael Cowlishaw, ISBN 0-13-806332-X
  • Programming in REXX (McGraw-Hill, 1990), by Charles Daney, ISBN 0-07-015305-1
  • REXX with OS/2, TSO, & CMS Features (M V S Training, 1999), by Gabriel Gargiulo, ISBN 1-892559-03-X
  • Down to Earth Rexx (Perfect Niche Software, 2000), by William Schindler, ISBN 0-9677590-0-5
  • Rexx Programmer's Reference (Wiley/Wrox, 2005), by Howard Fosdick, ISBN 0-7645-7996-7
  • REXX Grundlagen für die z/OS Praxis by Johannes Deuring 2005, Germany, ISBN 3-486-20025-9
  • Complete list of 49 books through 2000

External links

Classic interpreters

  • Regina: open-source (LGPL) interpreter for Linux, BSD, Windows, etc.
  • REXX/imc: open-source (nonstandard license) interpreter for Unix and Linux systems.
  • BREXX: open-source (GPL) interpreter for DOS, Linux, Windows CE, etc.
  • Reginald: free interpreter for Windows.
  • roo!: free (Kilowatt Software) interpreter for Windows with object-oriented extensions.
  • r4: free (Kilowatt Software) interpreter for Windows.
  • REXX for Palm OS: shareware (Jaxo Inc.) interpreter for Palm OS.
  • Personal REXX: commercial (Quercus Systems) interpreter for Windows, OS/2 and DOS.
  • S/REXX: commercial (Benaroya) interpreter for UNIX and Windows.
  • uni-REXX: commercial (The Workstation Group Ltd.) interpreter for UNIX.

Other interpreters

  • Open Object Rexx web site
  • IBM NetREXX web site

Compilers

  • IBM Compiler and Library for REXX on zSeries

Newsgroups

  • comp.lang.rexx

Tutorials

  • Rexx for everyone: An introduction by David Mertz for IBM developerWorks.
  • Vladimir Zabrodsky's Album of Algorithms and Techniques for Standard Rexx
  • Vladimir Zabrodsky's An Introduction to the Rexx Programming Language
  • PLEAC-REXX: Programming Language Examples Alike Cookbook for REXX
  • Tips & tricks 3.60 by Bernd Schemmer (OS/2 INF format, 755 KB ZIP, 2004)
  • Rexx Frequently Asked Questions (FAQ)
  • Introductory Rexx Tutorial - SHARE, Spring 1997

  Results from FactBites:
 
REXX - Wikipedia, the free encyclopedia (1466 words)
REXX was designed and first implemented as an ‘own-time’ project between 20 March 1979 and mid-1982 by Mike Cowlishaw of IBM, originally as a scripting programming language to replace the languages EXEC and EXEC 2.
As such, REXX is considered a precursor to Tcl and Python.
Variables in REXX are typeless, and initially are evaluated as their names, in upper case.
  More results at FactBites »

 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m