How do I get the full name of the current (overload) function or sub
(whatever it be) ?
Sub SomeFunction()
Dim FullNameOfThisFunction = ???
msgbox(FullNameOfThisFunction )
end sub
-P
> How do I get the full name of the current (overload) function or sub
> (whatever it be) ?
Imports System.Reflection
Dim mb as MethodBase _
= MethodBase.GetCurrentMethod()
? mb. ...
HTH,
Phill W.
Thanks Phill . Very helpful.
I would also need the name of the caller. Is it simple to get ?
Sub Caller
me.CalledBy()
end sub
Sub CalledBy()
Dim FullNameOfCallerSub = ?????
msgbox(FullNameOfCallerSub)
end sub
'MethodBase.GetCurrentMethod().Name'
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Dim trace As New StackTrace()
Dim caller As StackFrame = trace.GetFrame(1)
Debug.WriteLine(caller.GetMethod(), "caller")
--
Hope this helps
Jay B. Harlow
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
<pamela...@libero.it> wrote in message
news:1161094126.5...@b28g2000cwb.googlegroups.com...
> Pamela,
> > I would also need the name of the caller. Is it simple to get ?
> You can use the System.Diagnostics.StackTrace &
> System.Diagnostics.StackFrame classes.
>
> Dim trace As New StackTrace()
> Dim caller As StackFrame = trace.GetFrame(1)
> Debug.WriteLine(caller.GetMethod(), "caller")
>
>
> --
> Hope this helps
Thanks very helpful.
Thanks to all.