Re: Does each routine know its name?
- From: "Jan Hyde (VB MVP)" <StellaDrinker@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jul 2007 09:06:46 +0100
"Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild
thoughts were released on Tue, 10 Jul 2007 14:14:46 -0400
bearing the following fruit:
How does MZ Tools help with this? I've only had time to look at a few basic
functions of it so far.
You can create templates, for example you can use a template
to insert your error code. MZTools can automatically insert
the name of the routine, the name of form\module as part of
that template.
Besides that it has tons of time saving features. And it's
free.
Rob
"Jan Hyde (VB MVP)" <StellaDrinker@xxxxxxxxxxxxxxxxxxx> wrote in message
news:mt8793tpbpegvdt3sp1d3s7fdm7ofprjbu@xxxxxxxxxx
LurfysMa <invalid@xxxxxxxxxxxxxxx>'s wild thoughts were
released on Tue, 10 Jul 2007 10:11:28 -0400 bearing the
following fruit:
Is there a way to get the name of a function into a variable in that
function?
I like to put the function name in the title field in MsgBox and other
debugging messages:
Call MsgBox("Some message",,"function name")
I have been using a constant:
Public Sub CoolFunction(p1, p2, ...)
Const smyname As String = "CoolFunction" 'Name of this routine
Then I can write:
Call MsgBox("Some message",,smyname)
If I ever change the function name, I only have to change that one
constant, but it would be better if the constant could obtain the name
automatically or even better if there is a property that would return
the function name.
me.name?
Do you change function names often?
Why do you want this anyway? The reason I ask is the only
scenario I've come across is for logging error information.
In which case you obviously don't have MZtools ;-)
--
Jan Hyde
https://mvp.support.microsoft.com/profile/Jan.Hyde
--
Jan Hyde
https://mvp.support.microsoft.com/profile/Jan.Hyde
.
- References:
- Does each routine know its name?
- From: LurfysMa
- Re: Does each routine know its name?
- From: Jan Hyde (VB MVP)
- Re: Does each routine know its name?
- From: Robert Morley
- Does each routine know its name?
- Prev by Date: Re: Does each routine know its name?
- Next by Date: Re: public global constants
- Previous by thread: Re: Does each routine know its name?
- Next by thread: Uninitialized boolean variables?
- Index(es):
Relevant Pages
|