Previous | Top | Index | Next |
Rexx interpreter calling syntax is:
Where:
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);endwill 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 |
Examples
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.
Examples
To write one line programrexx - 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...)and a sine diagram will be displayed.
Ctlr-Z
DO x=0 TO 6.28 BY 0.1 y = trunc(39*(sin(x)+1)) + 1 SAY copies(' ',y) || '*' END
Previous | Top | Index | Next |