home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!mimsy!nsisrv!Hypatia!leb
- From: leb@Hypatia.gsfc.nasa.gov (Lee E. Brotzman)
- Newsgroups: comp.lang.rexx
- Subject: PARSE dispute -- who is wrong?
- Message-ID: <leb.715571192@Hypatia>
- Date: 4 Sep 92 01:46:32 GMT
- Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
- Organization: Goddard Space Flight Center
- Lines: 47
- Nntp-Posting-Host: hypatia.gsfc.nasa.gov
-
- I am in the process of porting REXX code that was working on VM/CMS REXX and
- PC-REXX from Mansfield Software to UniREXX from the Workstation Group. I have
- run across a problem that I would like to get the group's input on before I
- bitch to the Workstation Group.
-
- Given a parse instruction like:
-
- parse var inline numrec lrecl desc'\'inline
-
- and the contents of inline are:
-
- '1234 567 File 1\4321 765 File 2'
-
- one can expect that the values of the parsed variables will be:
-
- numrec=1234 lrecl=567 desc='File 1' inline='4321 765 File 2'
-
- But if the contents of inline are:
-
- '1234 567\4321 765'
-
- Under VM/CMS REXX and PC-REXX the variable contents are:
-
- numrec=1234 lrecl=567 desc='' inline='4321 765'
-
- Under UniREXX from the Workstation Group the variable contents are:
-
- numrec=1234 lrecl='567\4321' desc=765 inline=''
-
- Clearly, my intended result is the one returned under VM/CMS REXX and PC-REXX,
- I have put in a work-around to deal with the result from UniREXX. The way I
- interpret the results is that the former two REXXes parse on the literal
- strings first (i.e. they see the '\' before assigning to variables) whereas
- UniREXX parses on the variables first and the literals second.
-
- My Question: Does the REXX langauge specify parsing on literal strings in the
- pattern first or the variables? Or is this ambiguous? I apologize for not
- going to Cowlishaw for the answer, but I was stupid enough to loan the book to
- someone long ago and I have lost track of my copy. I would appreciate a rapid
- answer because we have a software maintenance contract with the Workstation
- Group, and if they are in the wrong they should have this brought the their
- attention immediately.
- --
- -- Lee E. Brotzman Internet: leb@hypatia.gsfc.nasa.gov
- -- Hughes STX DECNET: NDADSA::BROTZMAN
- -- National Space Science Data Center BITNET: ZMLEB@GIBBS
- -- NASA Goddard Space Flight Center
-