title: Delphi passing parameters by reference or by value/copy
body: <p>Context 1</p>
  
  <pre><code>var text:String;
  
  text:='hello';
  
  myFunc(text);
  </code></pre>
  
  <p>Context2</p>
  
  <pre><code>function myFunc(mytext:String);
  var textcopy:String;
  begin
  
      textcopy:=mytext;
  
  end;
  </code></pre>
  
  <p><code>myFunc</code> on the Context2 was called from the Context1, the local variable <code>mytext</code> is pointing to a memory outside the Context2? or the <code>mytext</code> have have their own memory space inside the scope, and filled/copied with the same content of the <code>text</code>? I'm probably missing something really basic, because I'm getting a <code>access violation</code> error.</p>
  
  <p>There's any way to specify explicitly if a function should receive parameters by reference or by value, copying then like in C? I'm not sure about how I'm doing it.</p>