Aleks Kleyn wrote:
> When I call sub in VB I can sent value of variable or reference to this
> value.
I suppose that you mean the ByVal and ByRef keywords?
The ByRef keyword sends a variable _by_ reference. Don't confuse this
with sending _a_ reference, it's not the same thing at all.
When you send a variable by reference, the method can change the value
of that variable. When you send a variable by value, the method gets a
copy of the value, so that it can not change the variable itself.
The default for arguments is ByVal, and this is what you should normally
use. For a value type, sending by value means that a copy of the value
is sent to the method. For a reference type, it means that a copy of the
reference is sent to the method. The method can change the object that
the reference points to, but it can not change the reference variable
itself.
> The question is. Suppose I have class
> public class AA
> ...
> end class
> and declare object of this class
> dim objAA as AA
>
> Does objAA is value or it refers to memory where I keep appropriate value.
> If objAA is value how I can declare it as reference?
A class is a reference type, so the variable objAA is a reference.
--
Göran Andersson
_____
http://www.guffa.com