Howdy, Stranger!

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

Categories

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





  • Shawn CarterShawn Carter Member Posts: 0

    ___ [ http://forcoder.org ] free video tutorials and ebooks about \ MATLAB PL/SQL Java Delphi PHP Objective-C Swift Ruby C++ Perl R C Assembly Visual Basic .NET JavaScript C# Python Go Scratch Visual Basic Scala Scheme VBScript F# ABAP D Logo Erlang Bash Lua Julia Apex ML Dart COBOL FoxPro SAS Hack Fortran Alice Crystal Kotlin Lisp Ada Prolog LabVIEW Awk Transact-SQL Rust Clojure \ _____

Sign In or Register to comment.