[code]Public Function GUID() as String
static value as String
if Value="" then
Value = “…”
end if
End Function[/code]
Does the variable “value” consume memory when the method is not called for an instance/object?
So, when I put an extension method to object, and don’t want to use GUDI()-function for many objects,
is still memory wasted for every object instantiated? (I of course mean the additional memory for value)
Static variables are shared between instances, so there will only be one value in your entire app. If you need each instance to have its own value, make it a property instead.