How to get full command line parameters in REXX ? - OS2
This is a discussion on How to get full command line parameters in REXX ? - OS2 ; Hi/2.
I'm trying to get full command line parameters in REXX. The following
method works well in general, but I encountered a strange situation.
----- argall.cmd
/* argall.cmd */
PARSE ARG argall
SAY argall
-----
If I call argall.cmd with ...
-
How to get full command line parameters in REXX ?
Hi/2.
I'm trying to get full command line parameters in REXX. The following
method works well in general, but I encountered a strange situation.
----- argall.cmd
/* argall.cmd */
PARSE ARG argall
SAY argall
-----
If I call argall.cmd with parameters containing double slash(//), argall
has nothing after '//'. For example, if you call argall.cmd with
'http://komh.dnip.net', you can see only 'http:'. '//' later does not
put into argall.
How can I get full parameters containging '//' ?
--
KO Myung-Hun
Using Mozilla Mail 1.7.12
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 750 MHz with 512 MB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
-
Re: How to get full command line parameters in REXX ?
On Sun, 4 Dec 2005 13:39:43 UTC, KO Myung-Hun wrote:
> How can I get full parameters containging '//' ?
It's a peculiarity which happens because '//' means sometjing special.
There's a workaround in the REXX Tip and Tricks document (see Hobbes).
But it's not very long, so here it is (copied verbatim, I take no
credit):
-----------------------------------------------------------
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.
-------------------------------------------------------------
-
Re: How to get full command line parameters in REXX ?
> If I call argall.cmd with parameters containing double slash(//), argall
> How can I get full parameters containging '//' ?
ObjectREXX no longer has this problem, which is related to the fact
that // is reserved. A workaround can be found in RXTT*.zip@Hobbes,
section General hints for REXX -> Parameters -> Workaround for the
// limitation (and related links).
---
-
Re: How to get full command line parameters in REXX ?
Thanks.
Now, I switched to OREXX.
ML wrote:
> > If I call argall.cmd with parameters containing double slash(//), argall
>
> > How can I get full parameters containging '//' ?
>
>ObjectREXX no longer has this problem, which is related to the fact
>that // is reserved. A workaround can be found in RXTT*.zip@Hobbes,
>section General hints for REXX -> Parameters -> Workaround for the
>// limitation (and related links).
>
>
>
>---
>
>
--
KO Myung-Hun
Using Mozilla Mail 1.7.12
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 750 MHz with 512 MB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr