ZOC good so far but one gotcha is biting hard
Seems unbelievably simple but I just can't seem to get a ZOC xxx.zrx
script to call another zoc or rexx script as a function. ZOC has
Enterprise REXX built in but requires ZOC scripts to be named
xxx.zrx.
The implication is that ZOC won't allow chaining of ZOC Rexx scripts to other
scripts as functions.
The command ret=ZocExec("cmd...",3) & ret=ZocShell("cmd...",3) pass a command string to execute or for ZocShell, to the current command processor but this doesn't allow returing values from the called script, these Zoc commands only return a 0 for ok, 1 for failed.
(I have WinRexx, ReginalRexx, ObjectRexx, EnterpriseRexx & result is consistent across these various rexx for windows versions).
Any clues would be welcomed - Doug Marker
Test1: <<Enterprise Rexx>> **************************************************
If I just use Enterprise Rexx to run script1.rex below it succesfully
calls script2.rex which runs & returns the return value to script1.
This is the heart of how we want to use ZOC. This test works in all rexx versions
(Enterprise Rexx was installed & associated with .rex suffix for these tests - The Ent Rexx manual states that Rexx scripts should have /* in 1st line, col 1)
Script1.rex
/* REXX */
Say "Hello World from Script1.rex, I am about to call Script2.rex"
ret=Script2.rex()
Say "Returned from script2.rex = " ret
RETURN 0
Script2.rex
/* REXX */
Say "Hello World. I was called by Script1.rex. "
RETURN "Script2.rex Done"
Test2: <<ZOC>> *************************************************************
This fails - says it can't find the Script2.zrx() function. I have tried all manner of combinations of *.rex *.zrx & ZocExec & ZocShell.
Script1.zrx
/* REXX */
Say "Hello World from Script1.zrx I am about to call Script2.zrx"
ret=Script2.zrx()
Say "Returned from script2.zrx = " ret
RETURN 0
Script2.rex /* have tried .rex & .zrx as suffix !!! */
/* REXX */
Say "Hello World. I was called by Script1.zrx "
RETURN "Script2.zrx Done"
**************************************************************