Rexx Example Programs

The following examples show various types of Rexx programs running in the plug-in. Each example is intended to demostrate some aspect of the plug-in API, Rexx programming techniques, or the capabilities of Rexx plug-ins running as applets.

The standard plug-in installation allows you to run all command line type Rexx programs and DrRexx type visual Rexx programs. Other visual Rexx programs require additional run-times to be installed on your machine. You can install those run-times from the Install Runtimes page.

Due to bugs in various browsers not all the example programs will run on all browsers. The browsers that can run each example program are noted in the description for that program. Mozilla in the browser list refers to Mozilla versions 1.1b or higher, or IBM Web Browser version 2 or higher.

Rexx in Command Prompt Window

[Browsers: all]

This example shows a simple Rexx program that runs in its own OS/2 Command Prompt window.

Click here to run the demo.
Click here to download the HTML and Rexx code.

Rexx as Macro

[Browsers: all]

This example shows a simple Rexx program that runs as a macro of the plug-in. The program issues a few plug-in commands and displays the results.

Click here to run the demo.
Click here to download the HTML and Rexx code.

Query Colors

[Browsers: all]

This example queries the foreground and background colors used in the Rexx output window and returns those colors as hexadecimal values. The hexadecimal values can be used in the BGCOLOR and FGCOLOR parameters to change the colors of the output window.

After you start the program the color of the output window can be changed with the OS/2 Solid Color Palette and then queried to obtain the hexadecimal value for a specific color. The program also demonstrates how to close the browser window when the program is finished.

[Browsers: all]

Click here to run the demo.
Click here to download the HTML and Rexx code.

JavaScript to Rexx

This program demonstrates passing values from JavaScript to Rexx, using user defined parameters in the EMBED.

The HTML form has every type of input control defined in HTML. The HTML file uses a JavaScript function to pass all the input controls from the HTML form to the Rexx program via EMBED tag parameters.

[Browsers: all]

Click here to run the demo.
Click here to download the HTML and Rexx code.

Rexx to JavaScript - #1

This example shows passing values between a Rexx program and JavaScript. The Rexx program

[Browsers: all]

Click here to run the first version of the demo.
Click here to download the HTML and Rexx code.

Rexx to JavaScript - #2

The program is a second version of the above program. It does the same thing, except that is uses the JavaScript command to pass values into the open HTML screen rather than modifying the HTML file before displaying it.

The Opera browser will not allow a JavaScript program in one window to set variables in a JavaScript program running in another window. Therefor this example will not run on Opera browsers.

[Browsers: Netscape 4.04, 4.61, Mozilla]

Click here to run the second version of the demo.
Click here to download the HTML and Rexx code.

Rexx to Rexx Communication

This program demonstrates two Rexx programs concurrently running, each in its own plug-in instance, passing variables back and forth. The first program starts the second program and then suspends itself, waiting to be released by the second program.

Click here to run the demo.
Click here to download the HTML and Rexx code.

DrRexx Example Program - Drives

[Browsers: all]

This program is the Drives example from DrDialog distribution, modified to run in the plug-in.

Click here to run the demo.
Click here to download the HTML and Rexx code. Unzip drives2.zpp to get the Rexx source and bitmap files.

Message Pipe Example

[Browsers: all]

This program demonstrates sending messages from one plug-in instance to another The program is a simple DrDialog/DrRexx program that starts a second thread and reads messages from the message pipe on that secondary thread. Each message sent from the plug-in is displayed in a list box in the application.

To run this demonstration, open this application, then open the Command Processor application and enter send a message from the command processor application.

Click here to run the demo.
Click here to download the HTML and Rexx code.

Window Pipe Example

[Browsers: all]

This example shows a simple DrDialog/DrRexx program that starts a second thread and reads window position messages from the plug-in window message pipe on that secondary thread. Each message sent from the plug-in is displayed in a list box in the application.

The window message pipe is useful when the normal methods of linking an application to the plug-in do not work. For example some applications conflict with xPager when using regular linkage methods. by the application in the normal way.

Click here to run the demo.
Click here to download the HTML and Rexx code.

VXRexx Example Program - Push Button

[Browsers: all except Netscape 4.04] Click here to install the VX-Rexx runtime.

This example shows a very simple VX-Rexx program which displays a single push button. The program is included to show how to specify VX-Rexx programs in the SRC parameter of the HTML EMBED tag. This program runs as a macro of the plug-in.

Click here to run the demo.
Click here to download the HTML and Rexx code.

VX-Rexx Example Program - Calculator

[Browsers: all except Netscape 4.04] Click here to install the VX-Rexx runtime.

Requires the VX-Rexx runtime installed on your machine. Select VX-Rexx from Step 3 of the install page. The program is the calculator sample program from the VX-Rexx distribution modified to work with the plug-in. The program displays a calculator with graphical keys. It demonstrates a graphical Rexx application running as an applet on an HTML page.

Click here to run the macro demo.

Click here to run the separate process demo.
Click here to download the HTML and Rexx code.

VX-Rexx Example Program - Bouncing Globe

[Browsers: all except Netscape 4.04] Click here to install the VX-Rexx runtime.

This example shows a simple VX-Rexx program that demonstrates graphics what can be accomplished by a plug-in Rexx program. The program shows a globe that is dropped and bounces in a box. This is the sample "bounce" program that comes with the VX-Rexx distribution converted to run in the plug-in.

Click here to run the demo.
Click here to download the HTML and Rexx code. Unzip bounce.zpp to get the Rexx source and bitmap files.

GPF Rexx Example Program

[Browsers: all except Netscape 4.04] Click here to install the GPF-Rexx runtime.

This example shows a GPF Rexx program that illustrates a Rexx application as applet integrated into the HTML page. It also shows how advanced OS/2 PM and desktop features can be integrated into plug-in Rexx program.

This example creates two containers and populates the left container with items from a data file (gpfstaff.dat). You can drag objects from one container to the other container.

This program show drag and drop capabilities on a web page. The drag and drop in this program is limited to the program itself. With some additional GPF programming the objects could be dragged to the Desktop printer or shredder.

Two versions of the GPF demo are provided below: a compressed version and a non-compressed version. The compressed version contains the GPF program executable, along with the data file (gpfstaff.dat) used to populate the container. Since both files are contained in the single zip file, only one file transfer is needed from the web server. The <EMBED> parameter zippedFlag=1 identifies to the plug-in that the file specified in the SRC parameter is a zipped file. The GPF Rexx application queries the zippedFlag parameter to determine where to get the data file.

The second version is the uncompressed version. In this version the GPF application fetches the data file (gpfstaff.dat) from the web server.

Click here to run the compressed demo, The compressed size is about 34K
Click here to run the non-compressed demo, The non-compressed size of gpfCnr.exe is about 61k.
Click here to download the HTML and Gpf code.

VRexx2 Example Program

[Browsers: all except Netscape 4.04] Click here to install the VRexx2 runtime.

This example shows the plug-in running a Rexx program that utilizes VRexx2 functions for creating graphical windows and such. Because of the way windows are sized in VRexx2 it is impossible to run a VRexx2 application as an "applet"; instead it must run in its own window.

Click here to run the demo,
Click here to download the HTML and Rexx code.

Rexx/TK Example Program

[Browsers: all except Netscape 4.04] Click here to install the Rexx/TK runtimes.

NOTE: Rexx/TK v 2.0 does not work in the plug-in. Only version 1.2 works
Version 2 of rexxtk.dll library is not loadable by DosLoadModule()

This example shows the plug-in running a Rexx program that utilizes the Rexx/TK library for creating windows. Because there is no facility in TK for removing the window title bar and system menu it is impossible to run a Rexx/TK application as an "applet"; instead it must run in its own window.

Click here to run the demo,
Click here to download the HTML and Rexx code.

Installing Programs Using WarpIN

[Browsers: all except Netscape 4.04]

This example shows using the plug-in to automate WarpIN installations. It demonstrates specifying an FTP URL in the SRC parameter, automatically closing the browser window when program (the WarpIN install) finishes, preventing more than one copy from running at the same time, and prompting the user to save downloaded install package.

The install program installs a 5 line Hello World! Rexx program, along with an icon and desktop object for executing the program. There are three versions of the program:

  1. *.WPI file (4k) - Installs without prompting to save the install package
  2. *.WPI file (4K) - Installs and prompts to save the install package
  3. *.EXE file (1.3MB) - Installs without prompting to save the install package

Click here to download the HTML

Rexx Plug-in Tools

The next two applications are tools to help in developing Rexx programs that run in the plug-in.

Command Processor

[Browsers: all]

The plug-in application allows you to interactively send Rexx plug-in commands to the plug-in and see the results. It also shows the values of the wdMainArgs. stem variable that is set from the EMBED parameters.

To run the command processor click here

Rexx Program Tester

[Browsers: all]

This screens allows you to run any Rexx program from the plug-in. Once you are satisfied with the program and the HTML page that starts the program, you can create the HTML files that were used to run the program.

To run the screen click here