Home > Articles > Programming > General Programming/Other Languages

A Quick Rexx Tutorial

  • Print
  • + Share This
  • 💬 Discuss
Rexx is a simple "power" language. Wait, isn't that a contradiction in terms? Not according to Howard Fosdick. While Rexx is easy to learn and simple to use, it nonetheless provides some strong capabilities that are making it a popular programming language.

This quick tutorial introduces you to Rexx scripting. It assumes that you know how to script or program in at least one other language. Rexx is a platform-independent, standards-based scripting language described in the companion article "Rexx: What You Need to Know."

This article introduces standard, procedural Rexx. For object-oriented Rexx or Java-compatible Rexx programming, visit the Rexx Information web site or see my book Rexx Programmer’s Reference (Wrox, 2005). Rexx is a "power" language, so this tutorial just gets you started. Let’s go.

Rexx Basics

The Rexx language consists of a nucleus of operators (comparison, logical, arithmetic, and string). Rexx features a small instruction set of only a couple dozen instructions, surrounded by a large group of built-in functions. The language is easily extended by using external functions, available in hundreds of free Rexx tools function libraries. Figure 1 shows the basic parts of the Rexx language.

You code external functions in Rexx in the same manner as you do any built-in function (after issuing a statement or two to load the external function library).

Figure 1

Figure 1 The elements of Rexx.

Rexx variables may represent strings—character, bit, or hex. Or they may contain a string that represents a number, as shown in Table 1.

Table 1 Strings that Represent Numbers

Number

Examples

Whole or integer

’3’ or ’+6’ or ’989349829’

Decimal or fixed point

’0.3’ or ’17.3465’

Exponential, real, or floating-point

’1.235E+11’ or ’171.123E+11’

Rexx variables are not typed. They contain strings that represent either string or numeric values. If the variable contains a string that can be understood as a number, your script can perform numeric operations with that variable.

  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus

Related Resources

There are currently no related titles. Please check back later.