The structure of a NetRexx program is extremely simple. This sample program, 'toast', is complete, documented, and executable as it stands:
/* This wishes you the best of health. */ say 'Cheers!'
This program consists of two lines: the first is an optional comment that describes the purpose of the program, and the second is a SAY statement. SAY simply displays the result of the expression following it -- in this case just a literal string (you can use either single or double quotes around strings, as you prefer).
To run this program, edit a file called toast.nrx and copy or paste the two lines above into it. You can then use the NetRexxC Java program to compile it, and the java command to run it:
java COM.ibm.netrexx.process.NetRexxC toast java toast
You may also be able to use the NETREXXC command to compile and run the program with a single command (details may vary -- see the installation and user's guide document):
netrexxc toast -run
Of course, NetRexx can do more than just display a character string. Although the language has a simple syntax, and has a small number of statement types, it is powerful; the language allows full access to the rapidly growing collection of Java programs known as 'class libraries', and allows new class libraries to be written in NetRexx.
The rest of this document introduces most of the features of NetRexx. Since the economy, power, and clarity of expression in NetRexx is best appreciated with use, you are urged to try using the language yourself.
[ previous section | contents | next section ]
From 'nrover.doc', version 1.113.
Copyright(c) IBM Corporation, 1996, 1997. All rights reserved. ©