> Hi > I could be wrong, but. > I think that byref command should behave like this: > > a = 0 > TestFunction(a) > Print a > > Public Function TestFunction(Byref x as Integer) > Inc x > End > > Result: > 1 > > > And if you like to pass byref argument byval instead for some reason, > you should do this: > > a = 0 > TestFunction(Byval a) > Print a > > Public Function TestFunction(Byref x as Integer) > Inc x > End > > Result: > 0 > > There are reasons why one design function to take parameters byref, > and so, it should be default behavior. > Need to pass byref argument byval is rare exception (I think). > Maybe there are some technical restrictions why this is as it is. > And maybe this is not good enough reason to change syntax anymore... > What do you think? > > > Jussi >
The reason why ByRef must be specified both in function declaration and in function call is explained in the documentation wiki there: http://gambasdoc.org/help/doc/byref Regards, -- Benoît ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user