The following sample programs are included with REXX as .CMD files. Using the online version of this guide, you can view these samples from the OS/2 Toolkit REXX Samples directory. To view a sample REXX program, click on a highlighted program name. The command file will be displayed using the OS/2 system editor.
CCREPLY.CMD
This program demonstrates how to use reply to run two methods at the same time.
This program demonstrates how to create a complex number class using the ::CLASS and ::METHOD directives. An example of subclassing the complex number class (the Vector subclass) is also shown. Finally, the Stringlike class demonstrates the use of a mixin to provide some string behavior to the complex number class.
This program demonstrates a way to define a factorial class using the subclass method and the .methods environment symbol.
This program demonstrates the difference between GUARDED and UNGUARDED methods with respect to their use of the object variable pool.
This sample creates a simple node class and uses it to create a logic tree. The logic tree is filled in by playing a simple guessing game.
This program demonstrates the use of the START method and the GUARD instruction to control the running of several programs. In this sample, the programs are controlled by one 'guarded' variable.
This program is similar to the MONTH1.CMD exec found in the OS/2 2.0 REXX User's Guide. This version demonstrates the use of arrays to replace stems.
This program demonstrates the use of ::CLASS and ::METHOD directives to create a simple implementation of a CMS-like pipeline function.
This file implements a semaphore class in Object REXX.
This program demonstrates how to implement a stack class using ::CLASS and ::METHOD directives. Also included is a short example of the use of a stack.
This program demonstrates use of the ::REQUIRES directive, using the complex number class included in the samples.
This program demonstrates how you could use the pipes implemented in the pipe sample.