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 [ 01 | November | 1998 ]

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


Date: Sun, 1 Nov 1998 12:21:22 PDT
From: "Gregory W. Smith" <gsmith@well.com >
Reply-To: scoug-programming@scoug.com
To: < "scoug-programming@scoug.com" > scoug-programming@scoug.com >
Subject: SCOUG-Programming: Pipes and REXX

Content Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

On Sun, 1 Nov 1998 11:20:38 PDT, Steven Levine wrote:

>In <199811011535.HAA07465@smtp.well.com>, on 11/01/98
> at 07:35 AM, "Gregory W. Smith" said:
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>
>>On Sat, 31 Oct 1998 18:23:46 PDT, Steven Levine wrote:
>>>In <199811010025.QAA19174@smtp.well.com>, on 10/31/98
>>> at 04:25 PM, "Gregory W. Smith" said:
>>>
>>>>-----BEGIN PGP SIGNED MESSAGE-----
>>>
>>>>Is there an elegant way to invoke a command from within REXX and have it
>>>>redirect the output to the standard input? Right now I am using pipes as
>>>>in the example:
>>>
>>>I suspect you want to invoke bar and pipe it's output to RXQUEUE:
>>>
>>> 'bar | rxqueue'
>>>
>>>Then use
>>>
>>> parse pull
>
>>So I have to replace all of my calls to IO functions such as linein() and
>>charin() with a 'parse pull somevariable' instruction? Then use
>>'somevariable' in the expression in place of linein().
>
>Yes, your logic will look something like:
>
> do while queued() \= 0
> parse pull line
> /* Process line */
> end
>
>The logic is the same. queued() replaces lines() and pull replaces linein.
>
>> It seems a lot easier to just replace the calls to linein() with calls
>>to linein('\temp\tempjunk') and just use tempoarary files. Besides, I
>
>It's your call. RXQUEUE will be faster because there will be no file I/O.
>Makes a difference if you are filtering a lot of data.
>
>>would have to re-do the logic of my program since I was already using a
>>stack. I would have to check after each 'parse pull' to see if I had the
>>re-directed STDIN or if I had stack data.
>
>I'm missing something here. Doesn't queued() do the test you need or are
>use already using the RXQUEUE?

I was already using the push and queue for other reasons in my program.
My program structure is something like this:

/* Main processing loop */

do while lines() > 0
linetoprocess = linein()
.....
if ....... then /* Save something for final output */
do
....
push 'Some temporary results ' || moreprocessing(linetoprocess)
end
....
end /* main processing loop */

/* final cleanup */

do while queued() > 0
parse pull savedresults
say savedresults
end /* final cleanup loop */
exit
===============================================================
Gregory W. Smith (WD9GAY) gsmith@well.com
finger gsmith@well.com for PGP public key
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNjzDPjtML4mvizAhAQGR3QP/VxUTLwD5GsdNgMMGYDY+HghR1qcArIZw
bDOiFJi7ySONcE9OoZy3LEAfiPpXuWHz3ZaL84aZ87AMv3vVQ9u4IkqPHMGvcv3K
kLFzPNNM28LO9u1YK9lBTen2AMfgbPMbZbKWOiJRFRKCg2jOyFtsJ9CBZn+L5vsi
xx3kdWWpu1Q=
=SnfV
-----END PGP SIGNATURE-----

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

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 [ 01 | 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.