+ Reply to Thread
Results 1 to 2 of 2

Name of calling procedure

  1. #1
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Name of calling procedure

    If a procedure A calls another procedure B, can I get the name of procedure A in proc B?
    In below example, I am looking for piece of code to replace "??????", so that it should return either a or c

    Please Login or Register  to view this content.
    Thanks
    ajay

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Name of calling procedure

    Hi,
    I think the
    Please Login or Register  to view this content.
    is close to what you want - but it looks like it can't give back a Sub name.

    How about creating Public Variables called Sub1, Sub2, Sub3
    When a Sub starts you would have a line of code to put the Sub Name in the Public Variable
    Just before the Sub ends you would remove the name from the Subs.

    Essentially you would be creating your own Subroutine Stack function that would keep the name of the current Sub along with the past Sub names in the Global Variable Stack.

    I think this would work for you.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1