Chapter 2. Meet Object Rexx

Table of Contents
The Main Attractions
Rexx and the Operating System
A Classic Language Gets Classier
The Object Advantage
The Next Step

Rexx is a versatile, free-format language. Its simplicity makes it a good first language for beginners. For more experienced users and computer professionals, Rexx offers powerful functions and the ability to issue commands to several environments.

The Main Attractions

The following aspects of Rexx round out its versatility and functions.

Object-Oriented Programming

Object-oriented extensions have been added to traditional Rexx, but its existing functions and instructions have not changed. The Object Rexx interpreter is actually an enhanced version of its predecessor, but with new support for:

  • Classes, objects, and methods

  • Messaging and polymorphism

  • Inheritance and multiple inheritance

Object Rexx supplies the user with a base set of classes: ALARM, CLASS, ARRAY, LIST, QUEUE, TABLE, SET, DIRECTORY, RELATION, BAG, MESSAGE, METHOD, MONITOR, STEM, STREAM, STRING, and SUPPLIER. Object Rexx is fully compatible with earlier versions of Rexx that were not object-oriented.

An English-Like Language

To make Rexx easier to learn and use, many of its instructions are meaningful English words. Rexx instructions are common words such as SAY, PULL, IF...THEN...ELSE, DO...END, and EXIT.

Cross-Platform Versatility

Versions of Object Rexx are now available for a wide variety of platforms, and the programs you create with Object Rexx will run on any of these, including Linux™ for Intel™, Linux for S/390®, and AIX®, as well as Windows 95™, Windows 98™, Windows NT®, and Windows 2000®.

Fewer Rules

Rexx has relatively few rules about format. A single instruction can span many lines, and you can include several instructions on a single line. Instructions need not begin in a particular column and can be typed in uppercase, lowercase, or mixed case. You can skip spaces in a line or entire lines. There is no line numbering.

Interpreted, Not Compiled

Rexx is an interpreted language. When a Rexx program runs, its language processor reads each statement from the source file and runs it, one statement at a time. Languages that are not interpreted must be compiled into object code before they can be 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 and provide formatting capabilities and arithmetic calculations.

Typeless Variables

Rexx regards all data as objects of various kinds. Variables can hold any kind of object, so you need not 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.

Impressive Development Tools

The Open Object Rexx Windows places many powerful tools at your disposal. These include a Rexx API to other languages like C/C++ or Cobol, OLE/ActiveX support, a mathematical functions package, file encryption functions for the Windows 2000 file system, and Windows Scripting Host support.