Re: operation on module arguments
- From: Craig Powers <enigma@xxxxxxxxxx>
- Date: Fri, 22 Sep 2006 12:03:21 -0400
Brooks Moses wrote:
The thing is that what "real A" means is "allocate a certain bit of memory for storing a real variable, and let the variable name 'A' refer to that bit of memory."
You're asking for it to potentially mean, instead, "allocate a certain bit of memory for storing a real variable, and let any attempts to update the variable name 'A' invoke a set of procedures as well as referring to this bit of memory." (But it would only mean this if something was defined in relation to it.)
Other languages/object models do have this feature. With COM objects, all objects have "properties", which are always accessed through getter and setter routines. VB (and extensions to C++) make this work like a variable on the client side.
e.g.
(class module Foo)
Private m_bar As Long
Public Property Let Bar(ByVal rhs As Long)
m_bar = rhs
' or you could do other stuff here...
End Property
Public Property Get Bar() As Long
Bar = m_bar
' or you could do other stuff here...
End Property
'It's not mandatory to have both getter and setter, you could omit one
'to have a read-only or write-only property, although a function will
'generally be more appropriate for the latter.
(client code)
Dim myFoo As New Foo
Dim baz As Long
myFoo.Bar = 5
baz = MyFoo.Bar
.
- References:
- operation on module arguments
- From: gottoomanyaccounts
- Re: operation on module arguments
- From: dpb
- Re: operation on module arguments
- From: gottoomanyaccounts
- Re: operation on module arguments
- From: Paul van Delst
- Re: operation on module arguments
- From: gottoomanyaccounts
- Re: operation on module arguments
- From: gottoomanyaccounts
- Re: operation on module arguments
- From: Brooks Moses
- operation on module arguments
- Prev by Date: Re: INTERFACE OPERATOR problem
- Next by Date: Re: Interface declarations
- Previous by thread: Re: operation on module arguments
- Next by thread: Re: operation on module arguments
- Index(es):
Relevant Pages
|
|