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.
 
Back
Top