[Toc][Index]

Workaround for the // limitation



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 or Get the parameters as seen by 
       CMD.EXE - 2 - 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
   REM *** This line was buggy in RXT&T versions prior to 3.20!
   REM     The parameter for the REXX program is the name of the
   REM     environment variable containing the parameters!
   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" )
 
                     /* if necessary, delete surrounding "             */
   thisParms = strip( strip( thisParms ), 'B', '"' )
   say "The parameters for this program are:" thisParms
 
 
 And third: Use only the OS/2 batch program to launch your REXX program. 
   

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs