objects are allways by reference.
That's not trueLocal lista:TList = New TList lista.AddFirst("Hello") Print lista.Count() ChangeList(lista) Print lista.Count() ChangeList2(lista) Print lista.Count() Function ChangeList(list:TList) list = New TList End Function Function ChangeList2(list:TList Var) list = New TList End Function
the output of this code is:
1
1
0
1
0
if they were passed always by reference, the output would be
1
0
0
0
0
the objects are passed by value, but having the value of an object lets you change its fields and use its methods and functions, etc.