Re: How to know instance name?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Just return a private member instead of calling the property again. Here you
call the property to returns the property value resulting in recursive
calls...

The example taken from the doc sis:
Class Class1
' Define a local variable to store the property value.
Private PropertyValue As String
' Define the property.
Public Property Prop1() As String
Get
' The Get property procedure is called when the value
' of a property is retrieved.
Return PropertyValue
End Get
Set(ByVal Value As String)
' The Set property procedure is called when the value
' of a property is modified.
' The value to be assigned is passed in the argument to Set.
PropertyValue = Value
End Set
End Property
End Class
--
Patrice

"Angel Mateos" <amateos@xxxxxxxxx> a écrit dans le message de news:
OS9Ms7QkGHA.1000@xxxxxxxxxxxxxxxxxxxxxxx
Is posible something like this?

public Class Class1
property readonly InstanceName
get
return me.InstanceName
endget
end property
end class



(...)

dim MyVariable as Class1
msgbox class1.InstanceName -> shows MyVariable

(..)


Thanks!



.



Relevant Pages

  • Re: How to know instance name?
    ... Public Property Prop1As String ... ' The Get property procedure is called when the value ... ' The Set property procedure is called when the value ... public Class Class1 ...
    (microsoft.public.dotnet.general)
  • Re: How to know instance name?
    ... Public Property Prop1As String ... ' The Set property procedure is called when the value ... public Class Class1 ... property readonly InstanceName ...
    (microsoft.public.dotnet.general)