Re: Updating parameters in a procedure / function
- Posted by ZNorQ <znorq at holhaug.com> Jul 17, 2006
- 568 views
Juergen Luethje wrote: > > ZNorQ wrote: > > > Juergen Luethje wrote: > >> > >> Unfortunally, official RDS Euphoria can't pass parameters by reference. > >> But Matt's OOEU (in the archieves) allows to do so. > > > > I see, but would I experience any incompabilities by using his? > > Most features of OOEU are compatible with RDS Euphoria. But there are > some exceptions, including passing variables by reference to functions > and procedures (for details please see the OOEU documentation). > Using OOEU you can write e.g.: > > <ooeucode> > procedure swap (object *x, object *y) > object temp > temp = x > x = y > y = temp > end procedure > > integer a, b > a = 1 > b = 4 > swap(a, b) > ? a -- prints 4 > ? b -- prints 1 > </ooeucode> > > But running the above code with RDS Euphoria, the first line will cause > an error. > > Regards, > Juergen > > -- > Please excuse my flawed English. My native language is Euphoria. Exactly what I wanted. I know there is forces that don't want pointers in Euphoria (I'm really one of them), but I see that sometimes it come in handy. Now, I know this have been discussed before, so please don't start one again, atleast not with this thread... :) Kenneth