Re: Does each routine know its name?



"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
.



Relevant Pages

  • Re: Does each routine know its name?
    ... following fruit: ... Of course, I try not to ever change function names, but it happens. ... In which case you obviously don't have MZtools;-) ... One of the options when creating a template is to ...
    (microsoft.public.vb.general.discussion)
  • Re: Formating changes using the macro to merge letters to separate fil
    ... The exact error code is 4605 command not available. ... Would i change the path to correspond where the template is? ... The macro creates a new document for each record based on normal.dot. ... Word MVP web site http://word.mvps.org ...
    (microsoft.public.word.mailmerge.fields)
  • [PATCH 2/6] integrity: Linux Integrity Module(LIM)
    ... which finds the template and increments the template refcount. ... This patch provides an integrity frameworkand placement ... new file mode 100644 ... an error code on failure. ...
    (Linux-Kernel)
  • CIS Security Baseline
    ... Win2k Gold template on a few Win 2k Pro machines, ... re-occuring event log message at every start up in the application log, ... The specific error code is 0x000004c7 [The operation was canceled ... known cause of this previously was an issue with Service Pack 1, ...
    (microsoft.public.win2000.security)
  • Re: [RFC][PATCH 4/5] integrity: Linux Integrity Module(LIM)
    ... pointer to template specific data ... * Store template specific integrity measurement. ... an error code on failure. ... Do a single unlock and return. ...
    (Linux-Kernel)