Home > Articles > Programming

A Quick Rexx Tutorial

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close Window

Howard Fosdick

Learn more…

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 ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Jennifer  BortelWin FREE iPhone Developer Books and Videos- Introducing @InformIT Giveaways
By Jennifer Bortel on February 5, 2010 No Comments

Apples’s recent iPad announcement made our hearts flutter so we couldn’t resist making an announcement of our own!

Today marks the first ever @InformIT Giveaway!

We’ll regularly post a video like this one profiling spectacular prizes we’re giving away—from books and videos to T-shirts and other exciting stuff. Check out the video below to see the giveaways for today, and then scroll down for more prize details and instructions on how to win them!

Dustin Sullivan"Every OSX developer should have this book on their desk."
By Dustin Sullivan on February 1, 2010 No Comments

That was the sentence Mike Riley ended his recent Dr Dobb's CodeTalk review of Cocoa Programming Developer's Handbook with.

David ChisnallCocoa Tip of the Day, 1/29/10
By David Chisnall on January 29, 2010 No Comments

Don't ignore old versions of OS X.

See All Related Blogs

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

Informit Network