SCOUG Logo


Next Meeting: Sat, TBD
Meeting Directions


Be a Member
Join SCOUG

Navigation:


Help with Searching

20 Most Recent Documents
Search Archives
Index by date, title, author, category.


Features:

Mr. Know-It-All
Ink
Download!










SCOUG:

Home

Email Lists

SIGs (Internet, General Interest, Programming, Network, more..)

Online Chats

Business

Past Presentations

Credits

Submissions

Contact SCOUG

Copyright SCOUG



warp expowest
Pictures from Sept. 1999

The views expressed in articles on this site are those of their authors.

warptech
SCOUG was there!


Copyright 1998-2024, 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.

The Southern California OS/2 User Group
USA

SCOUG-Programming Mailing List Archives

Return to [ 15 | November | 1998 ]

<< Previous Message << >> Next Message >>


Date: Sun, 15 Nov 1998 13:05:06 PDT
From: Steven Levine <steve53@earthlink.net >
Reply-To: scoug-programming@scoug.com
To: scoug-programming@scoug.com
Subject: SCOUG-Programming: Q. Rexx stem variables as parameters?

In <364F08D7.26BC@peterskye.com>, on 11/15/98
at 09:01 AM, Peter Skye said:

>but I'm writing a library routine so I won't know what the stem
>variable's name is.

There's no direct way to do this in classic REXX. I use interpret to get
the effect you want. Attached is a snippet that reads a file into a stem
using this technique. As to why I did not make this a procedure rather
than a global subroutine, I dunno. I'll have to think about it.

Steven

--
-----------------------------------------------------------
Steven Levine MR2/ICE #10183
-----------------------------------------------------------

/*=== ReadFile2Stem(FileName, Stem): Read file into stem variable ===*/

ReadFile2Stem:

if arg() \= 2 | \ arg(1, 'E') | \ arg(2, 'E') then do
say 'ReadFile2Stem: expected 2 arguments'
signal Error
end

if stream(arg(1), 'C', 'QUERY EXISTS') = '' then do
return 'ReadFile2Stem:' arg(1) 'does not exist.'
end

rf2sPath = arg(1)
call stream rf2sPath, 'C', 'OPEN READ'

rf2sStem = arg(2)
rf2sLine = 0

drop szCondition
do while lines(rf2sPath) \= 0
rf2sLine = rf2sLine + 1
call on NOTREADY name CatchError /* Avoid death on missing NL */
sz = linein(rf2sPath)
signal on NOTREADY name Error
interpret rf2sStem'.'rf2sLine' = sz'
if symbol('szCondition') = 'VAR' then
leave /* Last line missing NL */
end
interpret rf2sStem'.0 = 'rf2sLine
call stream rf2sPath, 'C', 'CLOSE'

drop rf2sPath rf2sStem rf2sLine szCondition

return '' /* Say no errors */

/* end ReadFile2Stem */

=====================================================

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.