--Menu--

 Home

 
FAQ’s
 
Example Apps
 
Tutorials
 
Introductions
 
Reference
 
Manuals
 
How-To’s
 
Best Practices
 
Standards
 Portability

 
Download Rexx
 
Download Tools
 
Sample Code
 
Forums
 
User Group
 
Links
 
Benchmarking
 
Books
 
Macros
 
News
 
 Classic Rexx:
  
Instructions
  
Functions

 
Open Object Rexx
 
NetRexx
 
Scripting Languages
 
 
About this Site
  
Contact Us
  
Site Map
  
Site Updates

 
Free How-To Guides
  
(Not Rexx)
 

     This site
 (C) 2005 - 2016

(Site is updated yearly,
some links may be stale)

Ad Free
Rexx LA
Free Tech Guides
Rexx Forums
Download Databases
Quick Reference
Rexx Tutorials
Rexx Macros
free rexx downloads

     This site
 (C) 2005 - 2016

(Site is updated yearly,
some links may be stale)

Rexx Banner
More How Tos

Scroll down to see the miscellaneous How-To’s and Tutorials on this page.        


Rexx for Android and iOS (4/2012)

The BRexx rexx interpreter runs on most major operating systems. Creator Dr. Vasilis Vlachoudis now has it running on the Android. To install it you need the scripting layer for Android SL4A, then you install the package BRexx.apk. You have full access to the Android API through the commands:

     call import "android.r"
     call AndroidInit

Full information and download are available
here.

Pierre G. Richard has announced that Jaxo Systems’ Rexx interpreter will run on Android
soon.

You’ll also want to read
this description of Kermit Kiser’s Android NetRexx IDE prototype. It includes download links and instructions.

How about iOS? Apple does
not allow scripting languages like Rexx in its App Store. So you have to jailbreak if you want to run Rexx. This how-to tells how to jailbreak and run NetRexx under iOS.

64 Bit Rexx (1/2012)

Want 64-bit Rexx? You’ve got it! Object-oriented ooRexx and Classis Rexx interpreter Regina are both available in 64 bit. Get info and download them from the
Downloads page.


Tutorial -- How to Run Rexx on Linux (8/2008)

Ubuntu Linux has exploded – estimates place its number of users worldwide over
10 million strong. Red Hat claims similar numbers. Linux has made the big time as a competitor to Microsoft’s Windows. So what Rexx do you use for Linux? Several Rexx interpreters run under Linux including ooRexx, Regina, BRexx, Rexx/imc, and NetRexx. Get info and download them from the Downloads page.

Rexx is not usually contained in the base distro distributions but that’s no problem. Several Rexx interpreters download as .deb files (for distros using Debian packages), .rpm files (for distros using Red Hat packages), or dmg files (for Mac OS X systems).

Or, just download the source as a compressed file (*.tar or *.tar.gz) and build Rexx from that. All the Rexx products include full information on how to install from source. It isn’t hard. Even if you have never done it before, just follow the simple instructions and you’ll succeed.

As a language with a long open source history, Rexx fits right into the Linux philosophy. Rexx presents a nice alternative to the other Linux scripting languages. For example, the default shell for most Linux distributions is bash.  The language is extremely powerful and useful … but syntax-challenged. It’s not uncommon to find IT sites having difficulty maintaining large bash programs.

Rexx’s ease of use and friendly syntax complement bash. Use whichever meets your objectives for a particular project.  You might even mix them together in large systems, with specific routines coded in each. It’s all about whatever works for you at a particular time for a particular purpose. “Thank you!” to those who have developed and donated these excellent free Rexx interpreters to all of us.

How to Run Rexx on Your Mac (5/2008)

Almost no viruses… an excellent user interface… unique apps. The Mac is the original anti-monopoly platform. So how do you run Rexx on it?

Among free Rexx interpreters for the Mac are Regina, BRexx, Rexx/imc, and ooRexx. Get information or download the products from the
Downloads page. Each includes install instructions.

Here’s an install example using Regina that shows two different ways to install it on your Mac. These instructions are for Mac OS X.  (You can run Rexx on older Mac OS Classic 7.9 – 9.0... but that’s a subject for another column).

1. Install Approach #1 – use a StuffIt file -- Download the Regina Rexx StuffIt file from
here. The StuffIt file is the one with the .sit extension containing a dmg file. Mount the Regina folder on your desktop, then do a standard Mac application install.

2. Install Approach #2 – build from source code. Download the Regina Rexx source from
here. This is a file with the extension of .tar.gz. Uncompress the file into a new Regina folder, and go to that directory in the terminal. Enter these two commands to build a binary executable from the source—

./configure
make

Put the resulting binary in a proper location in your search path, for example, /usr/local/bin.

Regina comes with a number of programs in its demo folder you can use to test your install.  A perennial favorite is the rexxcps program. This script measures how many Rexx clauses per second your machine executes. Just for fun, compare your results to those posted
here. You can also enter a simple test program—

#!/usr/local/bin
say “Rexx says Hello!”

The first line tells the operating system the location of the Rexx binary.

To enable Regina to load external function packages, you need to download and install the "dlcompat" package.  Read those instructions
here, or find them in the Regina documentation.

Tutorial -- Regular Expressions in Rexx (4/2007)

Regular expressions are a way to match strings. They allow you to describe a string or pattern matching algorithm in a single phrase. For this reason, they are extremely powerful. One regular expression can often replace a whole series of complicated string manipulation statements.

Once you form the regular expression, the programming language takes on all the work of applying the pattern to the text you search. Here’s a simple example. To list all files in a Unix or Linux directory, you might issue this operating system command--

ls *  (The equivalent Windows command line command is--  dir * )

The asterisk (*) is a regular expression. It matches all results in the command’s output. So the command succinctly lists all files in the directory. The power of regular expressions comes in when you match more complicated patterns.  Here we change the example to match only files ending in the characters .exe:

ls *.exe                       
---or---                       dir  *.exe

This next expression lists files beginning with any one the three lower-case letters a, b, or c, followed by any two other characters –

ls [a-c]??

You can build much more complexity into a regular expression, so regular expressions are a very economical way of expressing pattern matching algorithms. The beauty of this is that so many programming problems can be viewed as exercises in string and pattern matching. Regular expressions make for terse, powerful programs.

The downside is that regular expressions can look very complex to someone who has to maintain your code (or even to you, if you haven’t looked at your code for awhile!). Therefore you should always very fully comment any complex regular expressions you embed in your code. Nothing is worse than having to figure out – and debug – a very complex regular expression in someone else’s undocumented code

Perl is perhaps the best-known scripting language featuring built-in regular expressions. This is one reason programmers consider it such a powerful language. Perl excels at string manipulation and pattern matching problems.

Regular expressions are not built-in as part of the ANSI-1996 or TRL-2 language standards for classic, procedural Rexx.  But this does not matter. There are several free function packages that enable you to code regular expressions in Rexx that work with almost any Rexx interpreter.  (See our
Download Tools section for a list of free Regular Expression packages).

From the coding standpoint, it makes no difference whether regular expressions are built into the language or whether they come as part of an add-in function library. You just establish access to the external Rexx function library by a line or two of code in your script. Then you can code like regular expressions are just another part of the Rexx language.

Regular expressions come built-in as part of Open Object Rexx (ooRexx).  They are provided through the RegularExpressions Class, with its methods init, match, parse, pos, and position. (View a list of all Open Object Rexx classes and methods
here.)

You’ll want to use regular expressions in your Rexx code to succinctly express complicated pattern matching. Just make sure you write readable code and document what the regular expressions do.

VBScript Versus Rexx (4/2005)

I hesitate to write anything that even approaches a “language comparison.” Doing so stirs up deep emotions in many programmers and few look at such comparisons objectively. My view is that there are many programming languages in part because all offer their own benefits and advantages.

Nevertheless, one can learn so much by comparing programming languages. So, I’d like to say a few words about VBScript and Rexx in this article. This is not a formal comparison. The goal here is simply to note a few aspects of both languages developers should consider if using one or the other.

I’ve used many of the popular scripting languages. But I only recently plunged into VBScript for the first time. I wrote a 2,400-line program that generates scripts that run Oracle database backups and monitors their execution.

VBScript is a true subset of Microsoft’s Visual Basic. It is closely related to Visual Basic (VB), VB .Net and Visual Basic for Applications (VBA). Learn VBScript and you access a family of languages that Microsoft promotes as fundamental to Windows. VBScript and its kissin’ cousins run in browsers, as server- or client- side web scripts, and inside Office tools like Word and Excel. They access the Windows object model and do just about anything you can do under Windows.

VBScript was the default “batch” language for Windows until Microsoft released their PowerShell. Due to its ease of use and its Visual Basic heritage, VBScript is often used as the scripting “engine” for Windows Script Host (WSH), the programmable Windows administration tool. VBScript advantages include:

1. Access to all Windows features in all Microsoft Windows products
     -- Through the Windows ActiveX or COM object model
2. Tons of free code “snippets” on the web
     -- Anything you want to do, you can find free code examples to help you.
       You can even plug much of it straight into your application.
3. A huge user community, with all the support forums and tools that implies.

How does Rexx compare? You can do just about anything with Rexx (in one version or another) as you can with VBScript, because Rexx also runs as a WSH ActiveX scripting engine, and it too accesses the Windows object model.  But VB offers the advantages of numbers. It has way more Windows developers, tools, available code snippets, tutorials, web sites, books, and resources. It also enjoys official Microsoft support. Microsoft has anointed the VB family of languages its vehicle, and independent languages like Rexx (and Perl and Python and PHP), remain hungrily looking in from outside of Redmond’s charmed circle.

The VB family of languages are exclusive to Microsoft. They are proprietary and the company controls their development and where they run – which is Windows only. Although forms of BASIC, they don’t even remotely adhere to any BASIC language standards.

The Rexx family of languages contrasts to this in their portability and compatibility across a very wide of range of platforms. Rexx runs everywhere from handhelds to mainframes, and on everything in between. Rexx has strong procedural
language standards, and the informal but widely accepted object-oriented programming standard embodied in Open Object Rexx (ooRexx).

Learn VB to become a Windows Wizard. Learn Rexx for a skill that applies to all platforms. 

Let’s explore a few technical aspects of the two languages.

I found VBScript and Rexx to be very similar in their string processing power. Both contain an extensive set of functions that allow you to specify and resolve programming problems through the string processing paradigm. Rexx gains the edge with one really nice statement to which VBScript has no equivalent – parse. Using parse you can analyze or decompose strings with a single statement. With VBScript you manually parse by coding its many individual string functions.

Both languages offer huge advantages in their ease of use. Write VBScript or Rexx and your code has a good chance of becoming a living, breathing entity that others can easily read, change and maintain. Contrast this scripts written in languages like Perl and the Unix/Linux shell languages like bash or ksh. These are excellent languages, but they are not particularly good vehicles for writing easy-to-read, easy-to-maintain code.

VBScript lacks a few important features that Rexx offers. Associative arrays are an example. In Rexx you can access an array using arbitrary subscripts; in VBScript, you access arrays only by numeric subscripts. In my Oracle backup program, I needed to parse a text file containing input parameters specified in free-format. With Rexx I could have used parse and added keyword values to an associative array as I read them. With VBScript there was no alternative to a plodding routine to read, parse, and gather all the input parameters. I could gain some efficiencies by using a two-dimensional array, but ultimately an associative array is what I needed.

VBScript arrays are dynamic, but it’s up to the developer to resize them. Rexx dynamically expands and contracts arrays.

Both languages support regular expressions. VBScript added them to the base language in Version 5, while with Rexx, you use your favorite one of several regular expression function libraries.

I found VBScript to be a bit less flexible than Rexx in terms of free-formatting the code. For example, you can only code one statement per line. At times VBScript was a little verbose for my liking.

One subtle but maddening thing about VBScript is that it does not always function as you might expect. For example, I encountered a couple cases where I was tripped up by VBScript’s goofy idea of the Variant – its only data type – which comes in 14 subtypes. Yikes! Is that one data type or many? The answer is that it depends on which source material you read and what you’re doing in your program.

For example, I had a parsing routine that analyzed the contents of a string. My initial results were way different than I expected. Then I used a Replace function to change all tab characters in the string to spaces before starting the routine, and I got the expected results. VBScript’s string functions treat a tab character as different from just another byte in a string!

Here’s another example. I passed a variable that I had used for numeric computation in to a subroutine. But I found that the subroutine considered it a string. I had to use the Cint function to cast the value as an integer in the subroutine and get correct results. This is not what I expected since I had already used the variable in a numeric expression in the calling routine.

The inventor of Rexx, Michael Cowlishaw, says he based Rexx, in part, on BASIC. He likes BASIC’s ease of use and maintainability. But he was interested in making a more powerful language that consistently acted in the ways users would assume or expect. After using VBScript I can better appreciate his philosophy and the degree to which he succeeded.

In the end, I look at VBScript and Rexx in the same way I do most programming languages. Each has its own advantages and disadvantages. Depending on the situation, either (or both) could be great choices to meet your programming needs.

If you’re interested in learning VBScript, there are many books out there. I recommend
VBScript Programmer’s Reference (third edition). It includes a tutorial and a complete language reference, and it covers VBScript in all its many roles (WSH, client- and server- side scripting, etc). For full disclosure, I should mention that the book is in the same publisher series as my own Rexx Programmer’s Reference, which also tries to give you everything you need to know in one book.

[Home]  [FAQs]  [Example Apps]  [Tutorials]  [Intros]  [Reference]  [Manuals]  [How-To’s]  [Best Practices]
[
Standards]  [Portability]  [Download Rexx]    [Download Tools]    [Sample Code]  [Forums]    [User Group]
[
Links]  [Benchmarks]  [Books]  [Macros]  [News]  [Look-up: Instructions Functions]  [ooRexx]  [NetRexx]
[
Scripting]  [About the Site]  [Contact Us]  [Site Map]  [Sites Updates]  [Topics other than Rexx(C) 2005 - 2016