REXX - meaning of word
Rozmiar: 8938 bajtów


REXX



REXX (Restructured Extended Executor) is a programming language which was developed at International Business Machines, and several implementations are available under open source licenses. 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 Interpreter (computing) for REXX are available on a wide range of computing platforms, and compilers are available for IBM mainframes. ==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 * content-addressable data structures * 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 a 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. REXX syntax looks similar to PL/I, but has fewer notations; this makes it harder to parse (by program) but easier to use. == 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. It was designed to be a macro or scripting language for any system. As such, REXX is considered a precursor to Tcl and Python programming language. It was first described in public at the SHARE 56 conference in Houston, Texas, in 1981, where customer reaction, championed by Ted Johnston of SLAC, led to it being shipped as an IBM product in 1982. Over the years IBM included REXX in almost all of its operating systems (VM/CMS, VM/GCS, MVS, AS/400, OS/2, VSE/ESA, AIX operating system, CICS/ESA, and PC-DOS), and has made versions available for Novell Netware, Microsoft Windows, Java (programming language), and Linux. 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 Operating Environment, Digital Equipment Corporation, Microsoft Windows, Windows CE, PocketPC, MS-DOS, Palm OS, QNX, OS/2, Linux, BeOS, EPOC32, AtheOS, OpenVMS, OpenEdition, Apple Macintosh, and Mac OS X. Several freeware versions 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. 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. Since the mid-1990s, two newer variants of REXX have appeared: *NetRexx – which compiles to Java programming language 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 *ObjectRexx – 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. 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. On October 12, 2004, IBM announced their plan to release their ObjectRexx implementation under the Common_Public_License On February 22, 2005, the first public release of ooRexx (Open Object Rexx) was announced. == Syntax == ===Looping=== The DO control structure always begins with a DO and ends with an END. DO UNTIL: do until [condition] [instructions] end DO WHILE: do while [condition is true] [instructions] end Stepping through a variable: do ''i'' = ''x'' to ''y'' by ''z'' [instructions] end Looping forever until exiting with LEAVE: do forever if [condition] then leave end Looping a fixed number of times do ''i'' = ''x'' to ''y'' by ''z'' for a [instructions] 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 select when [condition] then [instruction] when [condition] then do [instructions] end otherwise [instructions] or NOP end NOP indicates no instruction is to be executed. ===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 (command line variable) * linein (keyboard) * pull (REXX data queue) * source (OS/2 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. == Flexible 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: do 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 end === Array support === REXX does not have explicit variable declarations, and likewise no arrays. However, a ''stem'' structure, similar to an array can be produced easily: 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... The drop stem. instruction unsets all ten variables of the form ''stem.i''. 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 == SIGNAL: A negative example == The REXX SIGNAL instruction is equivalent to the GOTO in other languages. When correctly used, it can be a very useful instruction, for example to intercept errors or other exceptional cases. But one can also produce illegible, difficult to read code: /* A Rexx Program */ signal define; use: say a signal end; define: a = "hello world" signal use; end: exit ==Error and exception treatment in REXX== It is possible in REXX to intercept and deal with errors and other exceptions, using the SIGNAL instruction. There are five system ''conditions'': ERROR, FAILURE, HALT, NOVALUE 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; a = 1 do a = (a + 1) // 10000 say a end halt: say "The program was stopped by the user" exit === Conditions === {| border=1 | error || Positive RC from a system command |- | failure || Negative RC from a system command |- | halt || Abnormal termination |- | novalue || An unset variable was referenced |- | syntax || Invalid REXX program syntax |} 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. ==Under OS/2== REXX 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 delimiters, /* */, to indicate to the operating system that it is a REXX program: /* sample.cmd */ say "Hello World" Instructions between quotes are passed to the OS: /* sample.cmd */ 'dir /p /w' == 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. Originally just "Rex" because the author liked how it sounded, the extra "x" was added to avoid collisions with other products' names. === Literature === * ''The Rexx Language: A Practical Approach to Programming'', by Michael Cowlishaw, ISBN 0137806515 * [http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=lU2UdsRB17&isbn=0764579967&itm=1 ''Rexx Programmer's Reference''] (Wiley/Wrox: 2005), by H. Fosdick, ISBN 0764579967 == External links == * [http://www.ibm.com/rexx/ REXX language page] at IBM * [http://www.rexxla.org REXX Language Association] * [http://www.oorexx.org/ Open Object Rexx web site] * [http://www.quercus-sys.com Quercus Systems]: Commercial REXX interpreter for Windows, OS/2, and DOS. * [http://regina-rexx.sourceforge.net Regina]: open-source (LGPL) REXX interpreter for Linux, BSD, Windows, ''etc.'' * [http://users.comlab.ox.ac.uk/ian.collier/Rexx/rexximc.html REXX/imc]: open-source (nonstandard license) REXX interpreter for Unix and Linux systems * [http://www-106.ibm.com/developerworks/library/l-rexx.html REXX for everone]: An introduction by David Mertz for IBM developerWorks. IBM software Programming languages Scripting languages

REXX



I think that the /* */ start is only required in OS/2 .CMDs. I guess that in Unix the required start is #!/bin/regina or something similar. -- User:Error : ah, didn't know. Will check with the REXX gurus. -- User:Viajero 09:03 30 Jun 2003 (UTC) : The "/* ..." is required in VM/CMS (called z/VM these days). VM/CMS systems check the first line of the file to determine which "executor" should be invoked to process the file. ::A first line beginning with "&TRACE" triggers the EXEC2 executor, and a first line with with neither &TRACE nor /* at its start drops through to the original EXEC procesor (a sort of BAT precursor). However, if evoked explictity as a macro, etc., the REXX interpreter does not require that the first line start with /*. :I can't speak to the OS/2 question, although I can say that Rexx started on VM and that this mechanism is predates the release of Rexx to the VM sites outside IBM. -- User:RossPatterson 15:53, 26 Sep 2004 (UTC) : Unix systems require a "#!" to identify the program that executes the script. In the Regina case, this is typically /usr/bin/rexx, just as in the Perl case it is often /usr/bin/perl. The usage is ancient - shell scripts have begun with "#!/bin/sh" for around 30 years. As to "/* ... */" in Unix, Regina does not require it and neither does Unix. -- User:RossPatterson 15:53, 26 Sep 2004 (UTC)

Rexx



#REDIRECTREXX


See other meanings of words starting from letter:

R

RA | RB | RC | RD | RE | RF | RG | RH | RI | RJ | RK | RL | RM | RN | RO | RP | RS | RT | RU | RW | RX | RY | RZ |

Words begining with REXX:

REXX
REXX
Rexx
Rexxar
Rexxar
REXX_programming_language
Rexx_programming_language


These materials are based on Wikipedia and licensed under the GNU FDL



YouTube.com videos better site than Turbo Tax 2007
encyklopedia online