RE: BUG in EUPHORIA PARSER
- Posted by Brian Broker <bkb at cnw.com> Aug 16, 2001
- 397 views
I take it back... Function 'inc1' is just fine and returns zeros because ctrl will never equal ctrl+1 (it is returning the result of a comparison). Function 'inc2' errors because it doesn't make sense by the definition of the language. -- Brian Brian Broker wrote: > So you are saying that they should both cause errors? It appears that > inc1() only returns 'ctrl' and stops executing the function because > adding the following loop to the program (and commenting out function > 'inc2') just prints a bunch of zeros. > > for i = 1 to 10 do > ? inc1() > end for > > > Bernie Ryan wrote: > > > > > > > > integer ctrl ctrl = 0 > > > > -- THIS WILL PARSE AND WORK PROPERLY > > function inc1() return ctrl = ctrl + 1 end function > > > > -- THIS WILL NOT PARSE CAUSES AN ERROR at the += > > function inc2() return ctrl += 1 end function > > > > > > > > Bernie > > >