Results 1 to 3 of 3

Thread: How to Call a variable subroutine or function

  1. #1
    Join Date
    Jan 2009
    Posts
    74

    How to Call a variable subroutine or function

    Hi friends,

    I want to store the name of a function or subroutine in a string and then i will call that subroutine or function based on the name that is stored in that string variable.I have try to do it but it's not working can anyone help me out with this issue.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: How to Call a variable subroutine or function

    Sure i will help you out with this issue before that may i know which application are you making your Code and if possible did you wrote any code then please provide it.

  3. #3
    Join Date
    Jan 2009
    Posts
    74

    Re: How to Call a variable subroutine or function

    I was try to do this in VBA and following are the code which i am trying out but it's not working

    Code:
    sub dummy(msgnumber as integer)
      msgbox msgnumber
    end sub
    
    sub main()
      dim SubName as String
      SubName = "dummy(1234)"
      Call SubName
    end sub

Similar Threads

  1. Call a function depending on the variable name
    By Captain Carrot in forum Software Development
    Replies: 5
    Last Post: 23-03-2010, 09:27 AM
  2. How to pass PHP variable value to jquery function?
    By Kasper in forum Software Development
    Replies: 5
    Last Post: 03-03-2010, 06:41 PM
  3. Accessing a variable outside a function without arg
    By BoanHed in forum Software Development
    Replies: 3
    Last Post: 04-12-2009, 01:35 PM
  4. Function with a variable number of arguments
    By Chrisch in forum Software Development
    Replies: 3
    Last Post: 20-11-2009, 02:03 PM
  5. What is the difference between a function and a subroutine?
    By Pooja in forum Software Development
    Replies: 5
    Last Post: 28-02-2009, 06:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,574,689.63887 seconds with 17 queries