[Gambas-user] function call by reference

Benoît Minisini gambas at ...1...
Fri Oct 9 14:14:00 CEST 2009


> Dear Developers of Gambas,
> 
> we are really interested in Gambas and we will use it to create a
>  connection between a plc and a computer.
> 
> Therefore we will use the shared library "libnodave".
> 
> Unfortunately "libnodave" needs some function calls by reference.
> 
> 
> 
> How is it able to call a function by reference?
> 
> 
> 
> The following way does not work:
> 
> 
> 
> Public sub read_from_plc()
> 
>   dim ph as long, di as long, dc as long, res as long
> 
>   res = initialize(BYREF ph, BYREF di, BYREF dc)
> 
>   ...
> 
> End sub
> 
> FUNCTION  initialize (ph as long, di as long, dc as long) as long
> 
> ...
> 
> End function
> 
> You can find this description:
>  http://gambasdoc.org/help/lang/methoddecl?view

As explained in that web page, you must specify ByRef both in the function 
call *and* in the function declaration. 

Regards,

-- 
Benoît Minisini




More information about the User mailing list