RE: BUG in EUPHORIA PARSER

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu