Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Passing parameters to asynchronously started rexx

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Passing parameters to asynchronously started rexx
#12867
Posted by: PeterJ 2009-05-01 14:18:11 Last edited by: PeterJ 2009-05-01 14:22:21 (Total edited 3 times)
when needed, I start rexx scripts asynchronously with:
rexdir=VALUE('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\RxLaunch.exe\Path', ,"WIN32")
ITERATEEXE(rexdir'RXLAUNCH','HELLO.REX',,,,'M')

until now there was no need for passing parameters. I played with
rxlaunch rexname parameters 
e.g.
rxlaunch hello.rex,'123'

but get an exception there. It seems RXLAUNCH is not implemented to receive any parameters. Is there any other simple was to pass and receive parameters, which I overlooked?

Peter
Message2.
#12868
Posted by: Jeff Glatt 2009-05-01 14:46:37
Actually, RxLaunch is designed to take a script name followed by upto 15 args. Each arg can be no longer than about 239 chars. Try making a shortcut to RxLaunch.exe and entering a script name and some args in the shortcut's properties. I suspect the problem is more likely your call to ITERATEEXE.
Message3.
#12870
Posted by: PeterJ 2009-05-01 19:13:09
I got the same exception error:

AppName: rxlaunch.exe    AppVer: 0.0.0.0    ModName: reginald.dll
ModVer: 0.0.5.5    Offset: 000216b9

I started the shortcut directly. The shortcut properties were:

C:\Programme\Reginald\RxLaunch.exe Hello.rex 1 2 3

the code contained in HELLO.REX is:

SAY TIME('L') 'Hello World' 
PARSE ARG p0,p1,p2,p3,p4,p5,p6,p7,p8,p9
SAY 'Input Parameters 'p0 p1 p2 p3 p4 p5 p6 p7 p8 p9
SLEEP(1)
SAY TIME('L') 'Hello World ends' 
Message4.
#12871
Posted by: PeterJ 2009-05-01 19:18:25 Last edited by: PeterJ 2009-05-01 19:19:05 (Total edited 1 time)
... it seems to be the parse statement in HELLO.REX causes the exception. I changed it to:

SAY TIME('L') 'Hello World' 
SAY "p0:" ARG(1)
SAY "p1:" ARG(2)
SAY "p2:" ARG(3)
SLEEP(1)
SAY TIME('L') 'Hello World ends' 

Now it works fine!
Message5.
#12873
Posted by: PeterJ 2009-05-01 22:51:14 Last edited by: PeterJ 2009-05-01 22:52:29 (Total edited 1 time)
everything is set now! you can use the following coding to start another rexx script asynchronously. This means the calling script continues without waiting for the return of the called procedure.

e.g.
startsubtask('HelloWorld',DATE(),TIME())

calls HelloWorld.rexx and passes 2 parameters to it

/* ---------------------------------------------------------------------------------
 * Start REXX asynchronously
 * ---------------------------------------------------------------------------------
 */
startsubtask:
PARSE ARG rexx
pass=''
DO i=2 TO 11
   IF ARG(i,'E')=1 THEN pass=pass','ARG(i)
      ELSE LEAVE
END
pass=SUBSTR(pass,2)
rexdir=VALUE('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\RxLaunch.exe\Path', ,"WIN32")
ITERATEEXE(rexdir||'RXLAUNCH.EXE',rexx'.REX',,,pass,'M')
RETURN
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0