Elements of Rexx

Rexx programs are made up of clauses. Each clause is a complete Rexx instruction.

Rexx instructions include the obligatory program control verbs (IF, SELECT, DO, CALL, RETURN) as well as verbs that are unique to Rexx (such as PARSE, GUARD, and EXPOSE). In all, there are about 30 instructions. Many Rexx programs use only a small subset of the instructions.

A wide variety of built-in functions complements the instruction set. Many functions manipulate strings (such as SUBSTR, WORDS, POS, and SUBWORD). Other functions perform stream I/Os (such as CHARIN, CHAROUT, LINEIN, and LINEOUT). Still other functions perform data conversion (such as X2B, X2C, D2X, and C2D). A quick glance through the functions section of the Open Object Rexx: Reference gives you an idea of the scope of capabilities available to you.

The built-in functions are also available in Rexx implementations on other operating systems. In addition to these system-independent functions, Rexx includes a set of functions for working with Windows itself. These functions, known as the Rexx Utilities, let you work with resources managed by Windows or Linux, such as the display, the desktop, and the file system.

Instructions and functions are the building blocks of traditional Rexx programs. To convert Rexx into an object-oriented language, two more elements are needed: classes and methods. Classes and methods are covered in later chapters. This chapter continues with traditional building blocks of Rexx.