OORexx Version 3.2.0 Reference current with program?

This is a discussion on OORexx Version 3.2.0 Reference current with program? within the REXX forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > REXX

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 05-26-2008, 08:28 PM
Gil Barmwater
Guest
 
Default Re: OORexx Version 3.2.0 Reference current with program?

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:\>
>
>

Reply With Quote
  #2  
Old 05-26-2008, 11:41 PM
rexbryan1@comcast.net
Guest
 
Default Re: OORexx Version 3.2.0 Reference current with program?

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
Reply With Quote
  #3  
Old 06-26-2008, 10:57 AM
rex
Guest
 
Default OORexx Version 3.2.0 Reference current with program?

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:\>


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:41 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.