Results 1 to 4 of 4

Thread: Function references in VB?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    India
    Posts
    97

    Post

    Hi,
    I was wondering if any one knows how to pass a function reference to a VB routine?

    I have a class that exposes a public sub, for which one of my parameters must be the name of a function that this subroutine can execute.

    First, can this be done in vb? if yes HOW?

    Thanks
    Gaurav

    ------------------
    Gaurav Mahindra
    [email protected]



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

    Post

    Check this out -- uses CallByName
    http://www.vb-world.net/ubb/Forum3/HTML/002581.html

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

    Post

    If I get you right, you want one of your functions in your class to call a function? Why not raise an event? That's much easier :-)

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    India
    Posts
    97

    Post

    Well, thanks guys for the quickie replies
    And the winne is "Clunietp" Thanks mate, the perfect solution. This new to VB 6.0? Hadn't heard of it before. Anyways thanks.

    Crazy D, I don't want to raise an event. I'm designing a splitter control so i want to be able to pass in the function name corresponding to the re size logic. Using CallByName covers this perfectly. and leaves me event free Thanks for your reply any way.

    Cheers,
    Gaurav



    ------------------
    Gaurav Mahindra
    [email protected]



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