is it possible to get the name of a sub or function in runtime.
I would like to use this in errorhandling, so i could log the sub-name or functionname to file.
Printable View
is it possible to get the name of a sub or function in runtime.
I would like to use this in errorhandling, so i could log the sub-name or functionname to file.
No. Each of your sub/function names will have to be written into your error traps in design.Quote:
Originally Posted by robbedaya
well, u can check which module is being called/executed at a given instance of time.
just include a messagebox in all the procedures saying "You are in Module n - Procedure P()" so you will know about the current position of the compiler.
PS - sorry if i misunderstood your question :)
robbedaya,
Take a look at *******. It can put that tyoe of error code in all of your modules at once. MZ-Tools can sort of do it one routine at a time.
thanks for your replies. But the answers you are giving is what i want to avoid.
I would like to know the procedure name without typing it myself.
Is there a function that returns the name of the current procedure.
Does anything exist like:
VB Code:
msgbox "an error occured in " & GetCurrentprocedureName
robbedaya,
I gave you the only way to do it besides typing it yourself. And no you cannot do it that way.
is this kinda what your after :
Dim slnfo as string
'display the information
slnfo = "Now Dragging."
slnfo = slnfo + source.Tag
slnfo = slnfo + "Over The Form."
slnfo = slnfo + "State ="
slnfo = slnfo + Str$(State)
txtinfo.Text = slnfo
Forgive me if i did'nt understand!!!! RedAngel
oké. thanks.Quote:
Originally Posted by randem