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 some 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.

Complementing the instruction set is wide variety of built-in functions (over 75 of them). Many functions manipulate strings (SUBSTR, WORDS, POS, SUBWORD, and more). Other functions perform stream I/O (CHARIN, CHAROUT, LINEIN, LINEOUT, and more). Still other functions perform data conversion (X2B, X2C, D2X, C2D, and more). A quick glance through the functions section of the Object REXX Reference will give you an idea of the scope of capabilities available to you.

The functions that are built into the REXX language are available in REXX implementations on other operating systems. In addition to these system-independent functions, REXX on OS/2 includes a set of functions for working with OS/2 itself. These functions, known as the REXX Utilities, let you work with resources managed by OS/2, such as the display, the Workplace 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 were needed: classes and methods. Classes and methods are covered in later sections. In the rest of this section we'll look at the traditional building blocks of REXX.


[Back: Running a REXX Program]
[Next: Writing Your Program]