Organization: Wirtschaftsuniversitaet Wien, Vienna, Austria
Date: Monday, 7 Sep 1992 17:08:54 CET
From: FLATSCHER Rony <RONY@awiwuw11.wu-wien.ac.at>
Newsgroups: comp.os.os2.advocacy
Subject: REXX (was Re: OS/2 vs NT features list, Revision 1.3
 <1992Sep3.015322.15745@midway.uchicago.edu> <Bu07yD.Hw7@rice.edu>

Amit:

REXX is a simple to use batch-language. By the same token it is a
powerful programming language (e.g. I wrote an OS/2-INI-editor/backup/
restore-program - showini.cmd, all in REXX !).

It is fun to use and very easy to learn. There exists no basic datatype
other than a string. Only in the context of operations the contents of
the variables are interpreted e.g. as numbers. Additionally there is
a fully fledged implementation of control of flows (to the point that
compiler builder's brains are burned out on many occassions, but make
the language easily to use for anyone else).

Under OS/2 REXX is interpreted, but will be preparsed on the first time
you use a REXX-batch, where the tokenized image will be stored in an
extended attribute. There are rumours though, that due to the fact that
REXX is an SAA-language (= strategical language for IBM which will be
eventually supported on all IBM-platforms), a REXX-compiler will be built
by IBM as is already the case for their mainframe-implementations (where
REXX was born; the author is Mike Cowlishaw who wrote PMGLOBE2.EXE - with
a REXX-interface !).

Astounishingly, REXX became part of the Amiga (!) operating system in
1989. The reasons being: easy to learn and powerful.

One concept of REXX makes it a great inter-application-language! Every
statement REXX does not understand, will be passed on to the "environment";
e.g. if REXX was started from OS/2, it was started by CMD.EXE in essence.
Therefore a string like "del d:\tmp\*" will be passed to CMD.EXE which does
in fact delete the tmp-directory. If REXX was started by EPM.EXE (the
enhanced editor) a string like "c /this/that/*" will be passed to EPM and
all occurrences of "this" will be changed to "that". Take a look at the
documentation of PMGLOBE2.EXE to see how you can mark the world with cities
(and their names) using REXX...

In the Amiga-world, REXX-aware applications started out after REXX became
standard in the operating system, thereby one can ***substitute*** macro-
languages of different applications, which in the Windows-world are proprie-
tary and a pain in the neck e.g. Excel, Word4Windows, Lotus 1-2-3, AmiPro,
QuattroPro etc.

In the OS/2-world the first true OS/2-applications are starting out to
allow the usage of REXX too. E.g. ObjectVision from Borland, Lotus 1-2-3
version 2.0, IBM's relational database (database manager, in fact, REXX is
the language with the easiest and most "natural" direct access to the data-
base). What this can do for you ? You learn one language: REXX. You use it
in lieu of all proprietary languages. You could load data from the IBM-
database into ObjectVision or Lotus 1-2-3, without any hazzles and transfer
the data to other applications which support the REXX-interface !

Lastly an example to show some REXX-basics:

/* this is a comment, because it is enclosed in C-style "brackets";
   it may span several lines. It ***must*** be the first thing in a
   REXX-batch-program, otherwise OS/2 assumes the old DOS-style
   batch-language */

a = "123"         /* this is a string containing "123" */
b = 456           /* this is a number, stored as the string "456 */

SAY a b           /* show the user the contents of a and b */
SAY a+b           /* show the user the result of adding a to b */
SAY a || b        /* catenate a and b without allowing a blank in between */
/*
   end of REXX-example
*/

The results would be:
    123 456
    579
    123456

---rony
Newsgroups: comp.os.os2.advocacy