home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / rexx / 995 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.6 KB  |  38 lines

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