Identifying a procedure's calling parent

  • Thread starter Thread starter Wayne M J
  • Start date Start date
W

Wayne M J

Sub mySub ()
MySub2()
End Sub

Sub MySub2()
Console.WriteLine("I was called by...")
End Some

Using the above example, is there anyway for MySub2 to identify its calling
parent?

If so, how?
 
Hi Wayne,

In every event is there the "sender" which is tranported as object, would be
very consistent in my opinon when you did use that also for it.

Cor
 
Hi,

Maybe this will help.

Private Sub MySub2()

Dim S As New StackTrace(True)

Dim strLine() As String = S.ToString.Split(ControlChars.NewLine)

Debug.WriteLine(strLine(2))

End Sub



Ken
 
Ken Tucker said:
Hi,

Maybe this will help.

Private Sub MySub2()

Dim S As New StackTrace(True)

Dim strLine() As String = S.ToString.Split(ControlChars.NewLine)

Debug.WriteLine(strLine(2))

End Sub

Thanks for that - that actually does the trick, and them some.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top