Cc,
in this example function A1& B1 are suppose to use same variable instance
that is m_person.
Yes, we all know how to ByRef works with functions. What we want to know is
how you expect the ByRef to work with the Property Set.
but if I can pass by reference m_person (form1) to
local_struct (class1) that will give less coding (no need to fill in value
to the function parameter). i try to use property set for local_struct but
property set can only use byval.
Huh? Where is this property set & what does it look like. Is it part of
Class1, Form1, Person, or some other class?
Can you continue this example and include the Property Set with ByRef so we
can see what you are attempting to do.
Remember procedures that have side effects are generally not a good idea. A
function that modifies its parameter is questionable, as a function is
intended to return a value, but wait did I mention it also modifies one of
its inputs, if I needed to modify the parameters, I would make it a Sub. A
property that only modifies its parameter is questionable. I can see
"Parent" like properties when when you set a property modifies both the
parent & child to maintain the relationship.
I strongly suspect you want (need!) the Person Structure to be a Person
Class (you know, the difference between Reference Types & Value Types, not
ByVal Parameters & ByRef Parameters).
Hope this helps
Jay