🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #6779

Re: Plus (Re: PIPEs (really: Slices))

#6779
From: Larry Phillips
Date: Sat, 17 Nov 1990 18:41
29 lines
2038 bytes
In <1990Nov17.093417.7937@agate.berkeley.edu>, pete@violet.berkeley.edu (Pete Goodeve) writes:
>I did check, and that's right: with (Lattice) _main you get the COMPLETE
>command input (minus the plusses, but plus the commandname itself).
>
>On the same lines, I thought it would be cute to try for a prototype "PIPE"
>command in ARexx.  Sure enough, if you do "parse args argin"/"say argin",
>you nicely get the complete input text.
>
>One problem... ARexx seems to have no concept of newlines!  I can find NO
>way to parse argin into single lines.  Anyone know of one?

There are a few ways to do this. One is to use the pos() or index() functions
within a substr() function to split out the individual lines. You will find it
easiest to assign the hex string to a variable, especially if the newline or CR
is part of another string. The other way I can think of is to use a translate()
function. Translate() allows you to translate more than one thing at a time, so
you can translate all spaces to some unused character, and at the same time,
translate all newlines or CRs to spaces. You can then split the lines on a word
basis, and translate the special characters back to spaces.

-larry

--
The only things to survive a nuclear war will be cockroaches and IBM PCs.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+
Technical Details
Message-ID: <2238@lpami.wimsey.bc.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!van-bc!

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!van-bc!
From: lphillips@lpami.wimsey.bc.ca (Larry Phillips)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Plus (Re:  PIPEs (really: Slices))
Message-ID: <2238@lpami.wimsey.bc.ca>
Date: 17 Nov 90 18:41:50 GMT
Lines: 29
Return-Path: <lpami!lphillips>
To: van-bc!rnews