I would say that it always works, but that it is easy to get confused and forget how you coded the procedure when writing the call. Comments don't cost much.
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Discussion List <IBM-***@LISTSERV.UA.EDU> on behalf of Frank Swarbrick <***@OUTLOOK.COM>
Sent: Monday, September 30, 2019 7:24 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: Rexx calls versus branching
I just wanted to bring up a "gotcha" when passing more than one "parameter". I believe with the example you give below, you are calling the "code" routine with one parameter, which has a value of '0 100'. The "code" routine then uses standard REXX PARSE logic to parse the characters before the space in to the first field (one) and the remainder (after the space) in to the second field (two).
The reason I mention it is because while this "generally works", it's easy to misunderstand what its truly doing. At least it was for me! This will definitely hit you if you are passing in "multi-word strings". For example:
call codeX 'this is string 1' 'this is string 2'
exit
codeX: procedure
parse arg one two
say 'one:' one
say 'two:' two
return
This gives the following results:
one: this
two: is string 1 this is string 2
On the other hand, the following gives what is probably desired.
call codeX 'this is string 1', 'this is string 2'
exit
codeX: procedure
parse arg one, two
say 'one:' one
say 'two:' two
return
Results:
one: this is string 1
two: this is string 2
Note the use of the comma to separate it into two distinct parameters. Also required on the "parse arg" (also note use of "parse arg" instead of just "arg", as the latter is short of "parse upper arg".
Hope this is correct, and helps REXX newbies. I don't claim to be any sort of REXX expert, but I ran in to this in the only "real life" REXX program I've ever written (as opposed to "toy" programs). If its not correct, then someone please correct it!
Frank
________________________________
From: IBM Mainframe Discussion List <IBM-***@LISTSERV.UA.EDU> on behalf of Lionel B Dyck <***@GMAIL.COM>
Sent: Monday, September 30, 2019 8:13 AM
To: IBM-***@LISTSERV.UA.EDU <IBM-***@LISTSERV.UA.EDU>
Subject: Re: Rexx calls versus branching
The 'CALL CODE 0' and 'CALL CODE 0 100' are simply calls to a subroutine with a label of code passing arguments of 0 or 0 and 100. Nothing magic or special.
See same:
/* rexx */
call code 0 100
exit
code:
arg one two
say 'one' one 'two' two
return
Lionel B. Dyck <sdg><
Website: http://secure-web.cisco.com/1WdBDU2cdrRZIYOV8-isbD85T8ttm0-aynccUDdjwbuNeOheTg1N_gtEdQGCR9iEEvhmmr05WN5BsJkokKKsJhOBhPG_QC3aY1Ku7MnqyJlwdSiGkVMuOiMOKroIT9tMkYHmiYm39lk516urvpYB0hKiyYydVYaQfZzEtFJe7o_zLGzOHcCfVkBDVQjFGa-tuQCF3u5lg0oZXrkVBSgjmKK43UyRy1ABv3X-IwPqMsgz6s4RET8cqIYeHhRF7o3vfESz4VK0SUQPoF-1IeQm3c9Mu4X3S3bC0IVm3Fd7gE4DErrD8rZIP8_JB5XpyZFDmfXFD06_1act13p-mdh8C6YpeaEUpxfTrPMQ3jwEAdt5ZgzlIVEwLu55uHOxg2v2cRdNDvMMkj4wYHunVUStE_4Trr3rThis1mCy61YIxzBFye5cUsOi_R8qbDz0Ur5EW/http%3A%2F%2Fwww.lbdsoftware.com
"Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are." - John Wooden
-----Original Message-----
From: IBM Mainframe Discussion List <IBM-***@LISTSERV.UA.EDU> On Behalf Of Bill Giannelli
Sent: Monday, September 30, 2019 9:10 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: Rexx calls versus branching
Thank you very much for your response.
I also have a Rexx routine that has "call code 0" and call code 0 100"
which seems to branch to a routine "code" for error handling?
how are the 0 and 100 values processed?
thanks
Bill
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN