SCOUG-Programming Mailing List Archives
Return to [ 15 |
November |
1998 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
Steven Levine wrote:
>
> There's no direct way to do this in classic REXX.
Well heck.
> I use interpret to get the effect you want. Attached is a
> snippet that reads a file into a stem using this technique.
Thanks. I'd forgotten about the second "arg()" parameter - I'll have to
start using it.
In poking around through _other_ people's code over the past couple of
hours, it appears that the most common method of passing a stem variable
to a procedure (and returning it with modifications) is to use a global
expose list, such as:
_subA.1 = '1st value'
_subA.2 = '2nd value'
call subA /* or use as a function, i.e. "Result = subA()" */
...
subA: procedure expose _subA.
... (use "_subA." as the stem variable; modify "_subA." as desired)
return
This works, 'though if you're calling the subroutine more than once with
different stem variables then you have to move the values into _subA.
and then move the results back to the original stem variable.
> As to why I did not make this a procedure rather
> than a global subroutine, I dunno. I'll have to think about it.
Don't think too hard! By using one stack, you don't have to worry
about how to pass the stem variable's name back and forth.
I may go this route and just drop the "procedure" altogether on this
routine. That way I can use "interpret".
Thanks.
- Peter Skye
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 15 |
November |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|