Thread View: bit.listserv.rexxlist
1 messages
1 total messages
Started by Otto Stolz
Wed, 17 Jun 1992 09:07
Re: interpret procedure expose ...
Author: Otto Stolz
Date: Wed, 17 Jun 1992 09:07
Date: Wed, 17 Jun 1992 09:07
85 lines
3736 bytes
3736 bytes
Hi REXXperts,
DSB100@psuvm.psu.edu (David Barr) writes:
> The new Rexx spec is slightly different with CMS 7. A "procedure"
> statement may appear only after the word "exit". [...]
On Tue, 16 Jun 92 15:52:13 GMT Edward T Spire said:
> Could you please quote a documentation reference that describes this
> new requirement? A CMS reference would be nice, but an SAA reference
> would be better.
If it is in "The REXX Language", as we've heard, it should also be in
SC24-5549-0 "SAA CPI Procedures Language Level 2 Reference". And behold|,
on page 62, we read:
: The PROCEDURE instruction must be the first instruction executed after
: the CALL or function invocation; that is, it must be the first
: instruction following the label.
Clearly, a PROCEDURE instruction after (or within) an INTERPRET
instruction is ruled out by this wording, provided that INTERPRET is
indeed an instruction.
INTERPRET is both listed in chapter 3 under the heading of "Keyword
Instructions", and termed an instruction in several places, e.g. on
page 50, referring to the value yielded by the expression in the
INTERPRET instruction:
: Any instructions (including INTERPRET instructions) are allowed, but
: note that constructions such as DO...END and SELECT...END must be
: complete.
Hence it apparently is an instruction, and INTERPRET "PROCEDURE" is
ruled out by page 62.
However, it would be helpful to the reader if this restriction would be
listed with the other INTERPRET restrictions on page 50. I think, I'll
have to fill in yet another of those Reader's Comments forms :-(
Level 1 of SAA REXX allows this construct, i.e. on page 50 of SC26-4358-0
"SAA CPI Procedures Language Reference", the rule quoted above is
missing. For compensation, Level 2 offers "subsidiary variable lists" in
the EXPOSE clause of the PROCEDURE instruction. I'll append a pertinent
example in both Level 1, and Level 2, style.
Happy programming,
Otto Stolz <RZOTTO@DKNKURZ1.Bitnet>
<RZOTTO@nyx.uni-konstanz.de>
-----------
/* Expose arbitrary variables in Level 1 style */
signal on novalue
trace o
address nil
parse value 1 2 3 with a b c
call p "A "; say ">>>>>>" a b c
call p " B"; say ">>>>>>" a b c
call p "A B"; say ">>>>>>" a b c
exit
p: interpret "PROCEDURE EXPOSE C" arg(1)
if symbol("A")="LIT" then a = -3
if symbol("B")="LIT" then b = -2
parse value a+1 b+1 c+1 with a b c
say "p(" || space(arg(1)) || ") >" a b c
return /* p */
-----------
/* Expose arbitrary variables in Level 2 style (not tested) */
signal on novalue
trace o
address nil
parse value 1 2 3 with a b c
x = "A "; call p; say ">>>>>>" a b c
x = " B"; call p; say ">>>>>>" a b c
x = "A B"; call p; say ">>>>>>" a b c
exit
p: procedure expose c (x)
if symbol("A")="LIT" then a = -3
if symbol("B")="LIT" then b = -2
parse value a+1 b+1 c+1 with a b c
say "p >" a b c
return /* p */
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads