Previous Top Index Next


Rexx interpreter calling syntax is:

rexx [-[trace]|-a|-F] rexx-program [args...]

trace is any of the valid trace commands, see below the trace cmd.
-a break args into multiple arguments
rexx -a foo.r one "two three" four
with foo.r being
do i=1 to arg(); say i":" arg(i);end 
will display
		1: one
		2: two three
		3: four
-F to run a program of one line, as a Filter for standard input. The interpreter adds the following lines to the code:
   Header: do forever;linein=read();if eof(0) then exit;
   Footer: ;end
The variable linein contains each time the current line read from stdin.
rexx-program is the filename of the rexx program to run. Extension is also needed.
args are the arguments passed to rexx program


rexx awari.r runs the awari program
rexx -a awari.r runs awari with trace=all
rexx ?r awari.r runs awari with interactive results trace
rexx banner.r Hi runs banner program with argument Hi
dir | rexx -F "SAY reverse(linein)" reverses each line from the system command dir.

When no trace is specified but only a single "-", rexx will wait for a program to be typed in STDIN (standard input) or if args exist will be executed as one line program.


To write one line program

rexx - DO i = 1 TO 10; SAY i; END

or you can use rexx as a calculator

rexx - SAY sin(0.5)*sqrt(3**2+4**2)

If there is no arguments following the "-", then rexx will wait for the user to type in the STDIN the program. To end the program type Ctrl-Z (Ctrl-D for UNIX).

rexx - (press return, and type...)
DO x=0 TO 6.28 BY 0.1
y = trunc(39*(sin(x)+1)) + 1
SAY copies(' ',y) || '*'
and a sine diagram will be displayed.

Previous Top Index Next