2011/9/8 Jussi Lahtinen <jussi.lahti...@gmail.com>

> >
> > By having to specify ByRef in the caller, you can't forget that the
> > function
> > will modify your variable (forgetting that leads to hard-to-fix bugs) and
> > it
> > help readers of your code.
> >
>
> Sorry, I don't understand what you mean, can you elaborate?
> I mean I forgot to write Test(Byref i), instead I always write old vb style
> Test(i).
>
> Jussi
>

 Hi Jussi. The keyword Byref allows that a parameter may cause side effects.
The double request to specify Byref on both, the real and the actual
parameter (in the declaration and in the call) help to the programmer to be
award that he or she could cause a side effect.

Side effects should be caused by returning a value by specifing "RETURN
value" according to the return data type specified in the declaration (i.e.
using a function, speaking in conceptual terms).

So, if you are porting VB code, maybe you'll probably have to use ByRef,
sometimes. Otherwise isn't recommended byref (according to Gambas idiom).

PD: sorry for my (probably unnecessary) verbosity and my poor english.



-- 
Fabián Flores Vadell
www.comoprogramarcongambas.blogspot.com
www.speedbooksargentina.blogspot.com
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to