[Gambas-user] Callback

Jussi Lahtinen jussi.lahtinen at ...626...
Fri Aug 12 16:03:46 CEST 2011


> I was experimenting with the code and simply this works :
>
> Public sub main()
>  calll(twotimes(3))
> end
>
> Public Sub twotimes(a As Integer) As Integer
>  Print a
>  a *= 2
>  Print a
>  Return a
> End
>
> Public Sub calll(cb As Pointer)
>
>  Print "should be printed twice"
>
> End
>


Hmmm... no it doesn't, I think you have lost your train of thought while
experimenting.
There is no function that takes other function as argument, so there is no
callback.
Only sub that takes function as argument for invalid pointer.

Jussi



More information about the User mailing list