[Gambas-user] Arguments passed by reference

R. Stormo rohnny at ...1248...
Sun Jan 20 12:08:44 CET 2008




Benoit Minisini wrote:
> 
> Hi,
> 
> I have finally implemented the ability to pass arguments by reference 
> in 'trunk'.
> 
> To do that, just add a '@' character before the argument. For example:
> 
> SplitName(FullName, @FirstName, @LastName)
> 
> Now here are the caveats:
> 
> * This is experimental.
> 
> * You can only use this syntax when calling Gambas code, not native code.
> 
> * This is slower than passing arguments by value.
> 
> I did that mainly to help porting VB projects to Gambas.
> 
> Enjoy it!
> 
> Regards,
> 
> -- 
> Benoit Minisini
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 
I have tried this by creating a module1 with a sub
public sub testing (invar as string, outvar as string)
outvar = "Hi " & invar
end sub

Called in main form
dim avariable as string
module1.testing("Rohnny", @avariable)
print avariable

But avariable is empty should it be "Hi Rohnny"?

Or have a missed something.


Regards Rohnny

My Gambas Community http://gambasforum.tk
-- 
View this message in context: http://www.nabble.com/Arguments-passed-by-reference-tp14973070p14980574.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list