| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| The problem is not with the documenatation but with your test. The clause x+=1 is an assigment statement, the same as x = x + 1. You have coded is as an expression following the 'say' keyword. It is NOT a valid EXPRESSION, hence the error message. (NB Rexx statements do not have side-effects unlike C or C++ so there is no "value" of an assignment statement.) If you try: x+=1; say x you'll find it works as expected. rex wrote: > Using the OORexx Version 3.2.0 Reference I tried a test of the extended > assinments syntax > to no avail. Is this reference (see snippet attached) from > http://www.oorexx.net/rexxref/book1.htm > in sync with the current version of OORexx? > Regards Rex > > ------------ > /* test of extendend assignments */ > x=1 > say x > say x+=1 > > ------------ > running on Windows XP Pro > C:\>rexx test.rex > 3 *-* say x+=1 > Error 35 running c:\TEST.REX line 3: Invalid expression > Error 35.1: Incorrect expression detected at "+=" > C:\> > ----------------- > > Reference > Version 3.2.0 Edition > Revision 0 > October 25, 2007 > W. David Ashley > Rony G. Flatscher > Mark Hessling > Rick McGuire > Mark Miesfeld > Lee Peedin > > ---Snip from Reference--- > Extended Assignments > The character sequences +=, -=, *= /=, %=, //=, ||=, &=, |=, and &&= can be > used to > create extended assignment instructions. > An extended assignment combines an binary operation with an assignment where > the term on the left side > of the assignment is also used as the left term of the operator. For > example, > a += 1 > is exactly equivalent to the instruction > a = a + 1 > Extended assignments are processed identically to the longer form of the > instruction. > ----End Snip > > C:\>rexx -ver > Open Object Rexx Interpreter Version 3.2.0 > Build date: Oct 30 2007 > Copyright (c) IBM Corporation 1995, 2004. > Copyright (c) RexxLA 2005-2007. > All Rights Reserved. > This program and the accompanying materials > are made available under the terms of the Common Public License v1.0 > which accompanies this distribution. > http://www.oorexx.org/license.html > C:\> > > |
|
#2
| |||
| |||
| On May 26, 6:28 pm, Gil Barmwater <gi...@bellsouth.net> wrote: > The problem is not with the documenatation but with your test. The > clause x+=1 is an assigment statement, the same as x = x + 1. You have > coded is as an expression following the 'say' keyword. It is NOT a > valid EXPRESSION, hence the error message. (NB Rexx statements do not > have side-effects unlike C or C++ so there is no "value" of an > assignment statement.) If you try: > > x+=1; say x > > you'll find it works as expected. > > rex wrote: > > Using the OORexx Version 3.2.0 Reference I tried a test of the extended > > assinments syntax > > to no avail. Is this reference (see snippet attached) from > >http://www.oorexx.net/rexxref/book1.htm > > in sync with the current version of OORexx? > > Regards Rex > > > ------------ > > /* test of extendend assignments */ > > x=1 > > say x > > say x+=1 > > > ------------ > > running on Windows XP Pro > > C:\>rexx test.rex > > 3 *-* say x+=1 > > Error 35 running c:\TEST.REX line 3: Invalid expression > > Error 35.1: Incorrect expression detected at "+=" > > C:\> > > ----------------- > > > Reference > > Version 3.2.0 Edition > > Revision 0 > > October 25, 2007 > > W. David Ashley > > Rony G. Flatscher > > Mark Hessling > > Rick McGuire > > Mark Miesfeld > > Lee Peedin > > > ---Snip from Reference--- > > Extended Assignments > > The character sequences +=, -=, *= /=, %=, //=, ||=, &=, |=, and &&= can be > > used to > > create extended assignment instructions. > > An extended assignment combines an binary operation with an assignment where > > the term on the left side > > of the assignment is also used as the left term of the operator. For > > example, > > a += 1 > > is exactly equivalent to the instruction > > a = a + 1 > > Extended assignments are processed identically to the longer form of the > > instruction. > > ----End Snip > > > C:\>rexx -ver > > Open Object Rexx Interpreter Version 3.2.0 > > Build date: Oct 30 2007 > > Copyright (c) IBM Corporation 1995, 2004. > > Copyright (c) RexxLA 2005-2007. > > All Rights Reserved. > > This program and the accompanying materials > > are made available under the terms of the Common Public License v1.0 > > which accompanies this distribution. > >http://www.oorexx.org/license.html > > C:\> Thanks. Works fine now. Rex |
|
#3
| |||
| |||
| Using the OORexx Version 3.2.0 Reference I tried a test of the extended assinments syntax to no avail. Is this reference (see snippet attached) from http://www.oorexx.net/rexxref/book1.htm in sync with the current version of OORexx? Regards Rex ------------ /* test of extendend assignments */ x=1 say x say x+=1 ------------ running on Windows XP Pro C:\>rexx test.rex 3 *-* say x+=1 Error 35 running c:\TEST.REX line 3: Invalid expression Error 35.1: Incorrect expression detected at "+=" C:\> ----------------- Reference Version 3.2.0 Edition Revision 0 October 25, 2007 W. David Ashley Rony G. Flatscher Mark Hessling Rick McGuire Mark Miesfeld Lee Peedin ---Snip from Reference--- Extended Assignments The character sequences +=, -=, *= /=, %=, //=, ||=, &=, |=, and &&= can be used to create extended assignment instructions. An extended assignment combines an binary operation with an assignment where the term on the left side of the assignment is also used as the left term of the operator. For example, a += 1 is exactly equivalent to the instruction a = a + 1 Extended assignments are processed identically to the longer form of the instruction. ----End Snip C:\>rexx -ver Open Object Rexx Interpreter Version 3.2.0 Build date: Oct 30 2007 Copyright (c) IBM Corporation 1995, 2004. Copyright (c) RexxLA 2005-2007. All Rights Reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution. http://www.oorexx.org/license.html C:\> |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.