home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!ucla-cs!netcon!hatch!richg
- From: richg@hatch.socal.com (Rich Greenberg)
- Subject: Re: Curious Question
- Message-ID: <BuFI3F.62n@hatch.socal.com>
- Organization: Hatch Usenet and E-mail. Playa del Rey, CA
- References: <Leon_Davidoff.04fe@panam.wimsey.bc.ca>
- Date: Fri, 11 Sep 1992 19:28:26 GMT
- Lines: 27
-
- In article <Leon_Davidoff.04fe@panam.wimsey.bc.ca> Leon_Davidoff@panam.wimsey.bc.ca (Leon Davidoff) writes:
- >I whipped up the following code to test something someone was talking
- >about in a message. During my testing I noticed something strange.
-
- [example code deleted)
-
- >What I would like to know is why b in Test1 is assigned the value ' y'
- >while in Test2 the value is 'y'. I think I ran across this problem
- >before and I found putting a variable Junk (which I never used) on the
- >end of the parse statement made it behave the way I thought it should.
- >Any ideas?
-
- This is the documented behavior of the parse statement. You could get the
- same result if you used a period instead of "c" in the parse.
- Rexx takes all the stray leading & trailing blanks associated with
- the last entry in the parse list and stuffs them there along with
- the actual (if any) data. I have seen the exact same thing in CMS
- Rexx. One of my standard techniques where I an expecting no more
- than a given number of values (3 in this example) is:
-
- parse upper arg v1 v2 v3 rest
- if rest /= ''
- then say 'Excess argument(s) "'rest'" ignored.'
-
- --
-
- Rich Greenberg - N6LRT - 310-649-0238 - richg@hatch.socal.com
-