Results 1 to 8 of 8

Thread: Calling Procedures

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Ireland
    Posts
    15

    Post

    I read strings from a file. These strings are procedure names.
    How do I get VB6 to call the function that is represented by the string I just read from the file?
    Any ideas appreciated.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    I had a problem similar to this and I had the following solution:

    1)
    Make your little script language and with a big Select Case switch trough your functions.
    (That's what I finally did)

    2)
    Make a dll in C and then use the API function to execute a function from a dll

    ------------------
    Fox
    [email protected]
    http://gigotz.tsx.org
    ...
    The truth is somewhere out there...

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Ireland
    Posts
    15

    Post

    Thanks but C is out of the question and I was really hoping to avoid the case statement, it's not really dynamic and means that the code has to be added to if you want to expand.

    I appreciate the response.

  4. #4
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    check out the VB 6 function CallByName
    Haven't used it, but maybe it does the trick for you.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Ireland
    Posts
    15

    Post

    Thanks alot, that did the job. I wasn't expecting to get that going till tomorrow.

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    I answered in the other forum in case you still need it:
    http://www.vb-world.net/ubb/Forum3/HTML/002581.html

  7. #7

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Ireland
    Posts
    15

    Post

    I saw that, thanks very much.

  8. #8
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    I can't know everything

    ------------------
    Fox
    [email protected]
    http://gigotz.tsx.org
    ...
    Every program can be reduced to one instruction which doesn't work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width