Kilowatt Software L.L.C.
Welcome to
Kilowatt Software L.L.C.'s
Microsoft® Windows® implementation of
"The REXX Language
A Practical Approach to Programming
[Second edition]"
by Michael Cowlishaw
ISBN 0-13-780651-5


Click here
to download r4™

If you are unfamiliar with Rexx see
Kilowatt Software L.L.C.'s extensive and free
Classic Rexx programming tutorial

 Classic Rexx features as per TRL-2*
  • All statement types
  • All built-in functions
  • All operators
  • Win32 command initiation
  • Arbitrary precision arithmetic
  • Excellent text parsing capabilities
  • Excellent string composition
  • Natural hexadecimal and binary literals
  • Integrated trace facility
  • Condition handling
* TRL-2 is "The REXX Language ..." book cited above
 Numerous examples
Disk space utilization, date selection, date conversion/calculation, metric conversions, loan calculation, compound interest, annuity value, HTML text generation, statistical analysis, factors, quadratic formula, kinematic equation solver (Physics), Palm OS blackjack, and more.
 Excellent string transformations
r4™ will be your 1st choice for many text file transformations.
 Natural data typing
No declarations !
 No compilation -- just edit, then run !
Programs are dynamically interpreted,
not compiled and linked.
 Designed for program readability
by people, not machines !
 Programs can be portably used in numerous system environments without source modification or recompilation.
 r4™ is not object-oriented ( OO ) !
You can achieve high productivity, without enduring a paradigm shift. When you want you to use object-oriented capabilities you can use roo!™ instead. roo!™ can execute r4!™ programs directly, without source modifications.
 Few implementation limits
r4™ uses extensive Win32 memory limits
 An easy programming language to learn
It's excellent for students who have never programmed before.
Source file conversion to binary ice files
You can chill your programs. This allows you to send your chilled REXX programs to others, without allowing them to see your source code !
 Integrated EXE conversion utility
You can execute REXX programs as standard EXE's
 Easy to understand error messages
 Includes TopHat™ and other supportive GUI programs, that execute as commands. These additional programs provide the following capabilities:
FILEDLG — File selection dialog
MSGBOX — Messages
PROMPT — Prompts for user responses
PICKLIST — Selection lists
TopHat™ — Fill-in-the-blank forms
 Superior to batch scripts
  • Excellent control flow capabilities
  • IF..THEN..ELSE, DO loops, SELECT cases
  • Function calls
Increase your productivity for common Windows activities!
 r4™ operates as a standard command in Windows 98/ME/NT/2000/XP environments

r4™ is accompanied by Revu™, which is a colorful text file viewing accessory. The following is an extract of the CSV2XML.REX example program, as displayed by Revu™. This segment splits a comma separated value (CSV) file line into a set of fields.

An interesting pair of productivity examples

The output of a directory listing utility is often produced in an order that is difficult to sort chronologically. The following program alters the content of directory lines so that dates and times can be sorted chronologically.

  /* rev.rex
    revise lines in directory listing so they can be sorted chronologically

      r4 rev < directoryListing > sortableDirectoryListing

    assume an input line has the following format:
     07-27-01  01:01AM                 1237 abc.dat
     07-27-01  11:01PM                 1237 def.dat

    the resulting output line will be
     2001/07/27 23:01     1237 abc.dat

  do lines()   /* process all directory listing lines */

    /* acquire a directory listing line, and assign text segments to variables */

    parse linein month'-'day'-'year hour':'minute +2 amOrPm size file

    /* adjust year to four digit format */

    if year > 70 then
      year = year + 1900
      year = year + 2000

    /* adjust hour to 24 hour clock format */

    if hr = 12 then
      hr = '00'

    if amOrPm = 'PM' then
      hour = hour + 12

    /* emit sortable line */

    say year'/'month'/'day hour':'minute right( size, 10 ) file


The above directory listing is in a plain text format. Suppose you would prefer the output in an HTML format, that is easier to read. This can be performed by the following additional program. Notice the command pipeline in bold text, which shows how both programs and the sort command are used in series.

  /* rev2html.rex
    finish revision of lines in directory listing

    assume input lines have the following format:
     2001/07/27 23:01     1237 abc.dat

      r4 rev < dirinfo.txt | sort /r | r4 rev2html > __readme.htm

  say '<html>'
  say '<head>'
  say '<title>Index of latest revisions</title>'
  say '<link rel=stylesheet type="text/css" HREF="kwsw.css">'
  say '</head>'
  say '<body background=backgrnd.gif>'
  say '<center>'
  say '<p>This is a listing of the files that have been added'
  say '<br>to the <b>latest</b> directory'
  say '<br>in reverse chronological order.'
  say '<p>'
  say '<table cellspacing=5 border=1>'

  do lines()   /* process all sorted lines */

    parse linein date time size file

    say '<tr><td>'date'</td><td>'time'</td><td>'size'</td><td>'file'<tr>'


  say '</table>'
  say '</center>'
  say '</body>'
  say '</html>' 

Example programs provided with r4™

The following REXX example programs are included:

AnnVal.rex Compute compounded value of an annuity (used with TopHat)
Anova.rex Analyze the variance of multiple columns of statistics
Anova2.rex Analyze the variance of multiple columns of statistics -- DETAILED
Asc2html.rex Converts a marked up Ascii text file to HTML
Ascii.rex Dislays the Ascii character code table
Caldisp.rex A calendar preparation program
Caldisp2.rex A faster calendar preparation program
ChgAll.rex Replace all occurrences of one string, by another
ChangeStr.rex An external procedure that emulates the 'changestr' builtin function
CompVal.rex Perform compound interest computation (used with TopHat)
CsvDef.rex Defines a new comma-separated value (CSV) file
CsvMaker.rex Generates comma-separated value (CSV) file form and addition program
Csv2xml.rex Converts comma-separated value (CSV) files to XML files
dateBase2dateStandard.rex converts a 'gregorian' day number nnnnnnnnn to an 'ISO standard' date -- YYYYMMDD
dateCalc.rex computes another date +|- #days relative to a specific date in numerous formats
dateOther2dateStandard.rex converts a specific date in numerous formats to an 'ISO standard' date -- YYYYMMDD
DatePick.rex Demonstration of program that uses DATEPICK.EXE
dateStandard2dateBase.rex converts an 'ISO standard' date YYYYMMDD to a 'gregorian' day number nnnnnnnnn
dateStandard2dateOther.rex converts an 'ISO standard' date -- YYYYMMDD to an equivalent date in numerous formats
Deal.rex Deals a hand of cards in Bridge format
Difference.rex Computes difference of two sets
Easter.rex Calculates Easter
Factorial.rex Calculates factorial
FileDlg.rex File selection dialog -- uses FileDlg accessory
FinCalc.rex Financial ratio computations (used with TopHat)
Gcd.rex Computes greatest common divisor of two numbers
GetContact.rex Get contact information (used with TopHat)
Hanoi1.rex A 'towers of hanoi' program
Hanoi2.rex Animated 'towers of hanoi' program
HtmlMiner.rex Extracts text from an HTML file that is not within tagss -- an HTML miner
Intersection.rex Computes intersection of two sets
Lcm.rex Computes least common multiple of two numbers
LoanCalc.rex Perform loan computations (used with TopHat)
Lottery.rex Picks 6 lottery numbers
Messager.rex Demonstration of program that uses MSGBOX.EXE
MetricArea.rex Metric area conversions (used with TopHat)
MetricDistance.rex Metric distance conversions (used with TopHat)
MetricVolume.rex Metric volume conversions (used with TopHat)
MetricWeight.rex Metric weight conversions (used with TopHat)
MetricTemperature.rex Metric temperature conversions (used with TopHat)
ParabolaGraph.rex Prepares a graph of a parabola, using the Poof!™ GraphIt program
Picker.rex Demonstration of program that uses PICKLIST.EXE
Powers2.rex Shows 'powers of 2' table
PresVal.rex Perform present value computation (used with TopHat)
prompter.rex Demonstration of program that uses PROMPT.EXE
Qt.rex Shows the present time in English
Rexxtry.rex An interactive REXX shell
Roman.rex Converts a number to roman numerals
Sayit.rex A tiny full function calculator
Sieve.rex Prime number algorithm -- the 'sieve of Eratosthenes' algorithm
Sqrt.rex Computes square root using Newton's algorithm -- an external procedure
Sumdisk.rex The best example -- summarizes disk space usage
TopoSort.rex Topological sort -- dependency analysis
Union.rex Computes union of two sets

Send e-mail product inquiries to:

Brightening your way into the future !