title: Argument passed ByVal to VB.NET Function and manipulated there
body: <p>In this Microsoft sample an array Of Doubles is passed to the functions <code>MultiplyMatricesSequential(...)</code> and <code>MultiplyMatricesParallel(...)</code> as argument result using <code>ByVal</code> modifier: <a href="http://msdn.microsoft.com/de-de/library/dd460713%28v=vs.110%29.aspx" rel="nofollow">http://msdn.microsoft.com/de-de/library/dd460713(v=vs.110).aspx</a></p>
  
  <p>Values in the arrays are being modified in these functions and the changes are available after the call to the functions returns.
  When I change <code>ByVal</code>to <code>ByRef</code> in function <code>MultiplyMatricesSequential(...)</code> nothing changes, when I change to <code>ByRef</code>in the second function the IDE complains arguments being manipulated in Lambda expressions cannot be passed by reference.</p>
  
  <p>I now wonder how the array values change in the caller when the use of <code>ByVal</code> is being forced?</p>