Variable Function Call

I have a friend who is writing some telnet apps using VB5.

He wants to recieve text commands and initiate the appropriate functions on the server machine.

The client may initiate one of hundreds of functions.


Instead of using an if,then structure (inflexible and long), He wants to know if he can load a variable with the handle to a fuction, then call that variable.

Does anyone know how to do this. I am an Assembly programmer and i know it can be done in assembly using the moving the OFFSET of the subroutine, but how can it be done in VB.


aXis


Comments

  • Someone told me that it can be done in VB6 using something called "CallByName" but that it can't be done in VB5. Personally, I have no clue and would like to be able to do this, but that's what they said.


  • Here your friend will have to use pointers to functions. In VB this can be done by using the 'AddressOf' operator. This is the only way in VB5. Also your friend has to place the called function in a module not in the Declaration Section of a form.


    Anton





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories