Jordan, You're right but I'm oversimplyfying my code to give an example of what I'm looking for. Is it possible in the CallingSomething routine to access the objAddress object and through some property (from the framework) get the name the variable from the caller? The thing is, I need to pass the object so I don't want to pass an additional string with it's name. I'm also passing this object to other routines so this makes it a less attractive solution. Cheers Ronald Bastien Strategium Technologies inc.
Ronald Bastien
Posts
-
class variable name -
class variable nameI could but I'm already passing the object so I don't want to pass the name as well. This object can also be passed down through an hierachy of calls and again, I don't want to have to pass the name with the object. Cheers. Ronald Bastien Strategium Technologies inc.
-
class variable nameHi all, Is there a way to retrieve the name of the variable containing an object passed to a subrouting. Here is a simple illustration meant to explain my question; I have the following two class defintions Public Class Address public City as string ... End Class Public Class Organisation Public MailingAddress as new Address public BillingAddress as new Address public sub CallSomething() ' pass the object whose variable name we want to display CallingSomething(MailingAddress) end sub public sub CallingSomething(objAddress as Address) 'display the name of the variable of objAddress as it is known in my Class Organisation. The display should be "MailingAddress". end sub End Class Using objAddress.GetType.Name gives me the "Address" which is the class name but I'm looking for the variable name "MailingAddress". If I had passed the BillingAddress, obviously I would want to display "BillingAddress". Can this be done in VB.NET? Thanks in advance. Ronald Bastien. Strategium Technologies inc.