home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!decwrl!concert!borg!news_server!martinc
- From: martinc@grover.cs.unc.edu (Charles R. Martin)
- Newsgroups: comp.lang.rexx
- Subject: newbie rexx programmer asks silly questions
- Message-ID: <MARTINC.92Sep3101933@grover.cs.unc.edu>
- Date: 3 Sep 92 14:19:33 GMT
- Sender: news@cs.unc.edu
- Distribution: comp
- Organization: UNC Department of Computer Science
- Lines: 40
-
- Just discovered rexx in the process of writing some OS 2 tools.
-
- Question 1: Can someone recommend a particular rexx implementation for
- DOS? Are there any pros and cons to be considered, or is one as good as
- another?
-
- Question 2: Given a string like this
-
- A*B*C*D*E*F/
-
- where the fields represented by cap letters can be arbitrary length,
- where * is a field separator, and / is a message terminator, I would
- like to parse it including the possibility that there will be null
- fields. That is, of one message were A*B**D*E*F/, I'd like to parse it
- into say an "array"
-
- a.1 = 'A'; a.2 = 'B'; a.3 = ''; a.4 = 'd' and so on.
-
- My first cut at that was
- line = "A*B**D*E*F\"
- ix = 1
- do while line <> ''
- parse value line with fld'*'line'/'
- a.ix = fld
- ix = ix + 1
- end
-
- which didn't quite work. Any suggestions? (By the way, there's an
- obvious recursive reformulation of this: are there advantages of the
- iterative vs recursive expression?)
-
- --
- Charles R. Martin/(Charlie)/martinc@cs.unc.edu/(ne crm@cs.duke.edu)
- O/Dept. of Computer Science/CB #3175 UNC-CH/Chapel Hill, NC 27599-3175
- H/3611 University Dr #13M/Durham, NC 27707/(919) 419 1754
- ----------------------------------------------------------------------
- "I am he who walks the States with a barb'd tongue, questioning every
- one I meet,/Who are you that wanted only to be told what you knew
- before?/ Who are you that wanted only a book to join you in your
- nonsense?" _Leaves of Grass_ xxiii.4.
-