[Gambas-user] Callback

Stephen A. Bungay sbungay at ...981...
Wed Aug 10 13:50:57 CEST 2011


I don't see the need myself, I do see how it allows the 'Something'  sub to vary what sub it calls by varying the 'test' parameter passed in, but I question the need and wonder, since 'test, could be varied, if that need could be fulfilled another way by select or if within 'Something.
Of course I don't know the contet of your application, only what we have as an example... not much to go on.

tobias <tobiasboe1 at ...20...> wrote:

>
>> hi,
>>
>> i wonder how one would specify a function callback to a function (i
>> haven't tried anything because nothing seems to me to work). no way with
>> a functions name as string and Class[name] because i can't get a pointer
>> to the actual symbol via this method but only to a .Symbol object. i
>> also can't call a pointer (as it would be with passing the functions
>> address) or something because it is not possible to cast a pointer to a
>> function... or do i miss something here?
>>
>> regards,
>> tobi
>oh, well it's possible using Object.Call(Me, name) but why isn't there 
>something like a Function datatype or the possibility to call a pointer? 
>is it too risky or not easily possible (just read an older post on the 
>list 
>(http://old.nabble.com/Signal-11-with-callback-functions-td31128062.html) which 
>says that there have to be wrappers between c and gambas functions 
>(something that is clear but i haven't had in mind), but the more i 
>think about it late at night, the more i get the idea that this isn't 
>related to my problem)
>what i'd like to do is:
>
>Public Sub test(i As Integer)
>   Print i
>End
>
>Public Sub DoSomething()
>   Something(5, test)
>End
>
>Public Sub Something(i As Integer, callback As Pointer)
>   callback(i)
>End
>
>any ideas?
>
>------------------------------------------------------------------------------
>uberSVN's rich system and user administration capabilities and model 
>configuration take the hassle out of deploying and managing Subversion and 
>the tools developers use with it. Learn more about uberSVN and get a free 
>download at:  http://p.sf.net/sfu/wandisco-dev2dev
>_______________________________________________
>Gambas-user mailing list
>Gambas-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user


More information about the User mailing list