The Object REXX interpreter allows you to write programs procedurally as well as in an object-oriented fashion. Its main benefits include:
- Easy to use and easy to learn
- Upwardly compatible with classic REXX
- Protects your investment by supporting your existing REXX program code
- Consists of many programming interfaces to existing applications, such as DB2 or C
- The ability to issue commands to multiple environments
- Offers powerful functions
- Based on English-like commands
- Enhanced with full object orientation
- Designed for object-oriented programming, and also allows REXX conventional programming
- Provides a REXX API to develop external function libraries written in C
- Includes applications developed mainly in C or C++
Choose Object REXX for your favorite operating system. It's available on AIX, Linux, OS/2 and Windows.
Additional background and information on REXX and Object REXX is found below:
What REXX offers
Using REXX
Object-oriented programming
From classic REXX to IBM Object REXX programs
What REXX offers
The following aspects of REXX round out its versatility and function:
- An English-like language
To make REXX easier to learn and use, many of its instructions are meaningful English words. Unlike some programming languages that use abbreviations, REXX instructions are common words, such as SAY, PULL, IF...THEN...ELSE, DO...END, and EXIT.
- Fewer rules
REXX has relatively few rules about format. A single instruction can span many lines, and you can include multiple instructions on a single line. Instructions can begin in any column and you can type them in uppercase, lowercase, or mixed case. You can also skip spaces in a line or entire lines, since there is no line numbering.
- Interpreted, not compiled
REXX is an interpreted language. When a REXX program executes, its language processor reads each statement from the source file and runs it, one statement at a time. Languages that are not interpreted must first be compiled into object code before being run.
- Built-in functions and methods
REXX has built-in functions and methods that perform various processing, searching, and comparison operations for text and numbers. These also provide formatting capabilities and arithmetic calculations.
- Typeless variables
REXX treats all data as objects of different kinds. Variables can hold any kind of object, so you do not need to declare variables as strings or numbers.
- String handling
REXX includes capabilities for manipulating character strings. This allows programs to read and separate characters, numbers, and mixed input. REXX performs arithmetic operations on any string that represents a valid number, including those in exponential formats.
- Clear error messages and powerful debugging
REXX displays messages with meaningful explanations when a REXX program encounters an error. In addition, the TRACE instruction provides a powerful debugging tool.
Using REXX
The IBM REXX language covers several application areas traditionally served by fundamentally different types of programming languages:
- Developing programs of varying complexity
REXX is a language that provides powerful character and arithmetical abilities in a simple framework. You can write short programs with a minimum of overhead, yet facilities exist to write robust, large programs.
- Tailoring user commands
Command program interpreters are an important component of operating systems. Most operating systems include some form of executive, shell, or batch language. In many cases the language is so embedded in the operating system that it is difficult to use outside its primary environment. REXX is a language that is designed primarily for generality but also for suitability as a command programming language.
- Creating macros
Many applications are programmable by using macros. In the data processing world, there is a different macro language for almost every type of application, such as editors, assemblers, interactive systems, text processors, spreadsheets, and databases. Because REXX is a character manipulation language, it can provide the macro language for all those applications. Its more conventional syntax and flexibility make it possible for the same jobs to be done quicker by less experienced people.
- Developing prototypes
Interpreter implementations of REXX can be highly interactive and permit rapid program development. This productivity advantage, together with the ease of interfacing REXX to system utilities for display and for data input and output, makes the language very suitable for modeling applications and products.
Object-oriented programming
Object-oriented programmers solve problems by identifying and classifying objects related to the problem. Then they determine what actions or behaviors are required of those objects. Finally, they write the instructions to generate the classes, create the objects, and implement the actions. The main program consists of instructions that send messages to objects.
A billing application, for example, could have an Invoice class and a Receipt class. These two classes could be members of a Forms class. Individual invoices are objects that are instances of the Invoice class.
Other advantages often associated with object-oriented technology are:
- Simplified design through modeling with objects
- Greater code reuse
- Rapid prototyping
- Higher quality of proven components
- Easier and reduced maintenance
- Cost-savings potential
- Increased adaptability and scalability
From classic REXX to IBM Object REXX programs
IBM Object REXX includes features typical of an object-oriented language, such as subclassing, polymorphism, and data encapsulation. It is an extension of the classic IBM REXX language, which has been expanded to include classes (a base set of classes is supplied), objects, and methods. These extensions do not replace classic IBM REXX functions or preclude the development or running of classic REXX programs.
You can program as before, program with objects, or intermix objects with regular REXX instructions. You decide when to use REXX's object-oriented features. In general, your current REXX programs will work without change. But because IBM Object REXX detects more errors at translate time than classic IBM REXX, you may have to fix these errors.
IBM Object REXX is fully compatible with earlier versions of IBM REXX that were not object-oriented.