![[About]](e:\os2httpd_1.3.2\htdocs\rexxtipsntricks\about.gif)
![[Toc]](e:\os2httpd_1.3.2\htdocs\rexxtipsntricks\toc.gif)
0.9b (c) 1995 Peter Childs
You may use the following workaround to pass parameters containing // to a REXX program. (see Parameters eaten by the REXX interpreter). I found the base idea of this workaround (using an OS/2 batch to call the REXX program) in a public message in one of the CompuServe forums. In contrast to this version, the version published in the CompuServe message used REXX queues to pass the parameter. But I think that's a lot of overhead for this purpose.
Note: You can also use the method described in the section Get the
parameters as seen by CMD.EXE to get around this limitation.
First, create an OS/2 batch file to launch your REXX program:
@ECHO OFF
REM *** OS/2 Batch program to launch a REXX program with
REM normally inpossible parameters for REXX programs
REM
REM *** init the environment variable for the parameters
SET REXXParms=
REM *** copy the parameters to the environment variable
REM (use a loop to handle more than 9 parameters)
REM
:PLOOP
IF "%1" == "" GOTO CALLREXX
SET REXXParms=%REXXPARMS% %1
SHIFT
GOTO PLOOP
:CALLREXX
REM *** now call the REXX program
myRexxProg REXXPARMS
Second, use the following prolog to get the parameters in your REXX program:
/* sample REXX program prolog to get the parameters from an */
/* environment variable */
/* get the name of the environment variable with */
/* the parameters */
parse arg parmVar .
/* get the parameters from the environment */
/* variable */
thisParms = value( parmVar , , "OS2ENVIRONMENT" )
say "The parameters for this program are:" thisParms
And third: Use only the OS/2 batch program to launch your REXX program.
Inf-HTML End Run - Successful