PC Review


Reply
Thread Tools Rate Thread

How can I detect the name of the variable received by a procedure?

 
 
Christian Blackburn
Guest
Posts: n/a
 
      7th Dec 2003
Hi Gang,
Can someone show me how to detect the name of the variable received by a
procedure? I'd really appreciate it. I would like the following code to
detect the name of the strStupid variable and output the string:

'-----------------------------------------------------------------------
Private Sub Form_Load()
Dim strStupid As String

MsgBox "NameOf strStupid" & varname(strStupid)
End Sub
'-----------------------------------------------------------------------

I realize that functionally in a program there are a trillion ways to
workaround the need to know the variable name, but I want to know if you can
just detect it too.
Thanks in Advance,
Christian Blackburn


 
Reply With Quote
 
 
 
 
Christian Blackburn
Guest
Posts: n/a
 
      7th Dec 2003
Hi Gang,
Woops looks like I posted this to the .Net group please disregard as I know
how to do this in .net, but I'm trying to do it in VB6.
Thanks any ways,
Christian Blackburn


"Christian Blackburn" <(E-Mail Removed)@Hotmail.com> wrote in
message news:(E-Mail Removed)...
> Hi Gang,
> Can someone show me how to detect the name of the variable received by a
> procedure? I'd really appreciate it. I would like the following code to
> detect the name of the strStupid variable and output the string:
>
> '-----------------------------------------------------------------------
> Private Sub Form_Load()
> Dim strStupid As String
>
> MsgBox "NameOf strStupid" & varname(strStupid)
> End Sub
> '-----------------------------------------------------------------------
>
> I realize that functionally in a program there are a trillion ways to
> workaround the need to know the variable name, but I want to know if you

can
> just detect it too.
> Thanks in Advance,
> Christian Blackburn
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      7th Dec 2003
* "Christian Blackburn" <(E-Mail Removed)@Hotmail.com> scripsit:
> Can someone show me how to detect the name of the variable received by a
> procedure? I'd really appreciate it. I would like the following code to
> detect the name of the strStupid variable and output the string:
>
> '-----------------------------------------------------------------------
> Private Sub Form_Load()
> Dim strStupid As String
>
> MsgBox "NameOf strStupid" & varname(strStupid)
> End Sub
> '-----------------------------------------------------------------------
>
> I realize that functionally in a program there are a trillion ways to
> workaround the need to know the variable name, but I want to know if you can
> just detect it too.


AFAIS that's impossible for local variables, in both, VB.NET and VB
Classic.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Procedure name as variable =?Utf-8?B?QnJpYW4=?= Microsoft Access VBA Modules 5 23rd Sep 2007 11:54 PM
How to detect return value from stored procedure used by a Details =?Utf-8?B?QmlzaG95?= Microsoft ASP .NET 1 24th Dec 2006 05:54 PM
Procedure name as variable Redbeard Microsoft Excel Programming 15 2nd May 2006 11:17 AM
Procedure to detect if an application is running =?Utf-8?B?QmlsbA==?= Microsoft Excel Programming 1 2nd Nov 2004 03:20 AM
Procedure to detect a running application and to register it. =?Utf-8?B?TWVtb3JpZXN3bQ==?= Microsoft Excel Programming 1 1st Nov 2004 09:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:54 PM.