Results 1 to 4 of 4

Thread: Getting Function/Sub Name

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    110

    Getting Function/Sub Name

    Is there any way by which we can find out the name of the current Sub or Function that is executing ? I require this for error logging. I want to log in which Sub or Function did the error occured. And donot want to hardcode the name of the same everytime.
    Anis Bombaywala

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Reflection.MethodBase.GetCurrentMethod.Name

    That should work.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Don't suppose you know how to modify that one to grab the name of the current IDE procedure if you want to use this in a vs.net macro by any chance?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Nope, haven't done anything with macros so far.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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