Results 1 to 4 of 4

Thread: Capture Procedure name

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    9

    Capture Procedure name

    Is there a way to capture the current procedure name in a variable? For instance, when I click on cmdError, I would like strProcedureName to = "cmdError_Click".
    Scott

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Sub cmdError_Click()
    2. strProcedureName = "cmdError"
    3. 'error code goes here
    4. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Posts
    9
    Thanks, Hack.

    I would rather not have to type the procedure name for each error. I would rather be able to pass the current procedure name another way. For instance...

    Right now, I am passing the current form (Me.Name), and active control (me.activecontrol.name) for every event that gets fired by way of a control.

    My problem is that when a procedure is run outside an event, I need to be able to capture the procedure name and pass it to another module. Instead of having to manually assign the procedure name, I was hoping to be able to do it with code somehow.
    Scott

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    there is no other way.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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